Last active
March 30, 2020 00:18
-
-
Save tennisonchan/5330eabf39c855c4e9004d7294441eb2 to your computer and use it in GitHub Desktop.
create and push the docker image to Google Container Registry gcr.io
This file contains 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
# 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