Tool to push Docker images into Shock and pull from Shock. Preserves some metadata and uses etcd configuration to deploy Docker images.
Either use the Dockerfile in this repository to statically compile skycore (The Dockerfile contains some more comments), or download pre-compiled binary (amd64):
wget https://github.com/wgerlach/Skycore/releases/download/latest/skycore
go get github.com/wgerlach/Skycore/skycore
docker build --tag skycore/factory:latest .
mkdir -p ~/skycore_bin
docker run -t -i --name sky_fac -v ~/skycore_bin:/gopath/bin skycore/factory:latest bash
cd /gopath/src/github.com/wgerlach/Skycore && git pull && /compile.sh
# container will need access to docker socket
mkdir -p ~/skycore_bin
docker run -t -i -v /var/run/docker.sock:/var/run/docker.sock --name sky_fac -v ~/skycore_bin:/gopath/bin skycore/factory:latest bash
go get -v github.com/mjibson/party
cd $GOPATH/src/github.com/wgerlach/
git clone --recursive [email protected]:wgerlach/Skycore.git
cd Skycore/skycore
party -d vendor -c -u
get IP addresses: Either a) from fleetctl (if installed)
export MACHINES=`fleetctl list-machines --full --no-legend | cut -f 2 | tr '\n' ' '` ; echo ${MACHINES}
or b) from nova (I admit, this is ugly.)
export MACHINES=`nova list --name <my_coreos> | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | tr '\n' ' '` ; echo ${MACHINES}
To get rid of the ssh warning "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED", you can run:
for i in ${MACHINES} ; do ssh-keygen -f "/home/ubuntu/.ssh/known_hosts" -R ${i} ; done
Do some testing (read coreos version or openstack uuid):
for i in ${MACHINES} ; do echo -n "$i: " ; ssh -i ~/.ssh/coreos.pem -o StrictHostKeyChecking=no core@${i} grep PRETTY /etc/os-release ; done
for i in ${MACHINES} ; do echo -n "$i: " ; ssh -i ~/.ssh/coreos.pem -o StrictHostKeyChecking=no core@${i} curl -s http://169.254.169.254/openstack/2013-10-17/meta_data.json | json_xs | grep uuid ; done
Finally, copy the binary:
rm -f skycore ; wget https://github.com/wgerlach/Skycore/releases/download/latest/skycore
chmod +x skycore
for i in ${MACHINES} ; do scp -i ~/.ssh/coreos.pem -o StrictHostKeyChecking=no ./skycore core@${i}: ; done