Skip to content

Instantly share code, notes, and snippets.

@ivanseidel
Last active July 12, 2017 00:59
Show Gist options
  • Save ivanseidel/d1aa1687279df2a733ad42527c8635be to your computer and use it in GitHub Desktop.
Save ivanseidel/d1aa1687279df2a733ad42527c8635be to your computer and use it in GitHub Desktop.
startup-script.sh
#! /bin/bash
echo User: $USER
/usr/share/google/dockercfg_update.sh
# Make sure container is stopped
docker stop tendaedu || true && /usr/bin/docker rm tendaedu || true
# Download ENV_LIST metadata and stores locally
curl "http://metadata.google.internal/computeMetadata/v1/project/attributes/ENV_LIST" -H "Metadata-Flavor: Google" -o list.env
# Pull image
docker pull gcr.io/tenda-edu-test/edu-backend:latest
# Execute image
docker run \
--name=tendaedu \
--log-driver=gcplogs \
--env-file=./list.env \
-p 80:80 \
-p 443:443 \
gcr.io/tenda-edu-test/edu-backend:latest yarn start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment