[英]Can I use docker image registry from google cloud build?
With Google Cloud Build, I am creating a trigger to build using a Dockerfile, the end result of which is a docker image. 使用Google Cloud Build,我创建了一个使用Dockerfile进行构建的触发器,其最终结果是一个Docker映像。
I'd like to tag and push this to the standard Docker image repository (docker.io), but i get the following error: 我想标记并将其推送到标准Docker映像存储库(docker.io),但出现以下错误:
The push refers to repository [docker.io/xxx/yyy] Pushing xxx/yyy:master denied: requested access to the resource is denied 推送指向存储库[docker.io/xxx/yyy]推送xxx / yyy:master被拒绝:请求的对资源的访问被拒绝
I assume that this is because within the context of the build workspace, there has been no login to the Docker registry. 我认为这是因为在构建工作空间的上下文中,没有登录到Docker注册表。
Is there a way to do this, or do I have to use the Google Image Repository? 有没有办法做到这一点,还是我必须使用Google Image Repository?
You can configure Google Cloud Build to push to a different repository with a cloudbuild.yaml in addition to the Dockerfile. 您可以将Google Cloud Build配置为使用Dockerfile之外的cloudbuild.yaml推送到其他存储库。 You can log in to Docker by passing your password as an encrypted secret env variable.
您可以通过将密码作为加密的秘密env变量传递来登录Docker。 An example of using a secret env variable can be found here: https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials#example_build_request_using_an_encrypted_variable
可以在此处找到使用秘密环境变量的示例: https : //cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials#example_build_request_using_an_encrypted_variable
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.