Steps to push containers to Google Container Registry:
- Create a new docker image locally
- docker build -t <company name>/<image name> .
- Create a new docker tag with naming pattern for Google Cloud Project ID
- docker tag <company name>/<image name> gcr.io/<Google Cloud Project ID>/<image name>
- Push the new image to Google Cloud Container Registry
- gcloud docker push gcr.io/<Google Cloud Project ID>/<image name>
- Pull the new image from Google Cloud Container Registry
- gcloud docker pull gcr.io/<Google Cloud Project ID>/<image name>
Reasons to use Google Container Registry:
- Free private hosting with your Google Cloud account
- Stores your data in a Google Cloud Storage bucket
- Better performance compared to Docker Hub
- You code base and docker images in the same place
That’s it!
Reference article: Pushing to Container Registry
Leave a Reply
You must be logged in to post a comment.