gcloud应用程序使用私有Docker映像进行部署 [英] gcloud app deploy with private docker images

查看:60
本文介绍了gcloud应用程序使用私有Docker映像进行部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,该项目的内部和外部都有一个Dockerfile,该Dockerfile是基本的私有映像.当我运行 gcloud app deploy 时,它将返回错误并显示以下消息

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'

在运行 gcloud app deploy 之前,我尝试过 docker login ,但是它不起作用

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

推荐答案

提供docker文件时,容器是从云而不是本地构建的.因此您的私人基本容器在构建时将不可用.最好的方法是在本地构建容器,然后推送到docker hub或gcr存储库.他们可以通过以下命令将容器推入仓库中

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]

查看文档以获取更多信息 https://cloud.google.com/container-registry/docs/pushing-and-pulling#pushing_an_image_to_a_registry

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

这篇关于gcloud应用程序使用私有Docker映像进行部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆