Skip to content

Instantly share code, notes, and snippets.

@tennisonchan
Last active March 30, 2020 00:18
Show Gist options
  • Save tennisonchan/5330eabf39c855c4e9004d7294441eb2 to your computer and use it in GitHub Desktop.
Save tennisonchan/5330eabf39c855c4e9004d7294441eb2 to your computer and use it in GitHub Desktop.
create and push the docker image to Google Container Registry gcr.io
# add the Dockerfile
# build the docker
sudo docker build ./
# copy the docker image id <docker_image_id>
# run the docker image local on 8080
sudo docker run -p 8080:8080 [SOURCE_IMAGE]
# tag the docker image
sudo docker tag [SOURCE_IMAGE] gcr.io/[PROJECT_ID]/[IMAGE]
# run docker push
# FYI https://cloud.google.com/container-registry/docs/advanced-authentication#gcloud-helper
sudo docker push gcr.io/[PROJECT_ID]/[IMAGE]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment