Last active
February 22, 2019 17:13
-
-
Save jamesward/60f715c3fdc40740ee5e72c33f3872c8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IMAGE=gcr.io/multiregion-atamel/where-am-i | |
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 | |
chmod +x jq-linux64 | |
sudo mount -o remount,exec /home | |
CID=$(docker ps | grep $IMAGE | awk '{ print $1 }') | |
TOKEN=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" -H "Metadata-Flavor: Google" | ./jq-linux64 -r ".access_token") | |
docker login -u oauth2accesstoken -p "$TOKEN" https://gcr.io | |
docker pull $IMAGE | |
docker stop $CID | |
docker rm $CID | |
docker run -d -p 8080:8080 $IMAGE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment