gcloud app deploy with private docker images

懵懂的女人 提交于 2021-02-10 19:57:28

问题


I have a project that has a Dockerfile inside and inside that Dockerfile is a base private image. When I run gcloud app deploy it will return an error with the below message

Error response from daemon: pull access denied for dean, repository does not exist or may require 'docker login'

I tried docker login before running gcloud app deploy but it did not work


回答1:


The easiest way to get this rolling is to push the private image up to Google Container Registry. The per-project registry is private (only available to folks who have access to your project).




回答2:


When you provide the docker file,a container is build from the cloud rather than locally. so your private base container will not be available while building. The best way is to build the container locally,then push to docker hub or gcr repository. They you can push the container in the repo by the command below

gcloud app deploy --image-url=[HOSTNAME]/[PROJECT-ID]/[IMAGE]

check on the documentation for more info https://cloud.google.com/container-registry/docs/pushing-and-pulling#pushing_an_image_to_a_registry



来源:https://stackoverflow.com/questions/53319804/gcloud-app-deploy-with-private-docker-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!