In my Dockerfile, how do I use the `COPY --from` syntax to use images from Google Container Registry?

10/14/2018

I'm using Google Kubernetes Engine, Cloud Build, and Image Registry. According to the kubectl docs, I can use external images in Dockerfiles with COPY --from. This would be very useful because when I run gcloud builds submit on my Dockerfile, I'd like to add in images already built on GCR instead of rebuilding everything in one Dockerfile.

I've tried adding lines like COPY --from=quickstart-image:latest /some/path/thing.conf /thing.conf but I always get

pull access denied for quickstart-image, repository does not exist or may require 'docker login'

Is there some authentication step I'm missing? How can I get this to work?

-- zakdances
docker
google-cloud-platform
google-container-registry
google-kubernetes-engine
kubernetes

1 Answer

10/14/2018

By default, quickstart-image refers to Docker Hub which, as error message suggests, it is not existing in Docker Hub.

If you want to use an image from GCR, you have to use full address like asia.gcr.io/project-name/repo-name.

-- mixth
Source: StackOverflow