Public | Automated Build

Last pushed: a year ago
Short Description
Copy Docker images between Docker machine and Shock
Full Description


Tool to push Docker images into Shock and pull from Shock. Preserves some metadata and uses etcd configuration to deploy Docker images.

Get Skycore binary

Either use the Dockerfile in this repository to statically compile skycore (The Dockerfile contains some more comments), or download pre-compiled binary (amd64):


Skycore from source (requires golang)

go get

Build container

docker build --tag mgrast/skycore .

Use container to compile and get binary:

mkdir -p ~/skycore_bin
docker run -t -i --name skycore -v ~/skycore_bin:/gopath/bin mgrast/skycore bash
cd /gopath/src/ && git pull && /

skycore execution within container

Use this bash alias:

export SKYCORE_SHOCK=<host>
export SKYCORE_SHOCK_TOKEN=<token>
alias skycore='docker run -ti --rm --env SKYCORE_SHOCK=${SKYCORE_SHOCK} --env "SKYCORE_SHOCK_TOKEN=${SKYCORE_SHOCK_TOKEN}" -v /var/run/docker.sock:/var/run/docker.sock --name skycore mgrast/skycore skycore'

update skycore vendors

# NOTE: this is deprecated
go get -v
cd $GOPATH/src/
git clone --recursive
cd Skycore/skycore
party -d vendor -c -u

Deploy the skycore binary on your CoreOS machines

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 | json_xs | grep uuid  ; done

Finally, copy the binary:

rm -f skycore ; wget
chmod +x skycore
for i in ${MACHINES} ; do scp -i ~/.ssh/coreos.pem -o StrictHostKeyChecking=no ./skycore core@${i}: ; done
Docker Pull Command
Source Repository

Comments (0)