Andrew Maxwell

How to push a Docker image to Google Container Registry

July 15, 2016

Steps to push containers to Google Container Registry:

  1. Create a new docker image locally
    • docker build -t <company name>/<image name> .
  2. Create a new docker tag with naming pattern for Google Cloud Project ID
    • docker tag <company name>/<image name><Google Cloud Project ID>/<image name>
  3. Push the new image to Google Cloud Container Registry
    • gcloud docker push<Google Cloud Project ID>/<image name>
  4. Pull the new image from Google Cloud Container Registry
    • gcloud docker pull<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.