无法推送到Google Container Registry(无法访问存储库) [英] Unable to Push to Google Container Registry (unable to access the repository)

查看:140
本文介绍了无法推送到Google Container Registry(无法访问存储库)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试从本地计算机将容器推送到Google Container Registry时,都会出现以下错误:

Whenever I attempt to push a container to the Google Container Registry from my local machine, I get the following error:

被拒绝:无法访问存储库;请检查您是否有权访问它.

denied: Unable to access the repository; please check that you have permission to access it.

如果我打开Cloud Shell,则可以毫无问题地推动容器.我已经尝试过多次进行"gcloud auth登录",但似乎没有什么区别.我在本地运行其他gcloud命令没有任何问题.任何帮助将不胜感激.

If I open the Cloud Shell, I can push containers with no problems. I have tried doing "gcloud auth login" several times and it seems to make no difference. I don't have any problems running other gcloud commands locally. Any help would be greatly appreciated.

推荐答案

供其他遇到类似问题的客户参考: https://github.com/docker/docker/issues/22910

FYI for other customers running into similar issues: https://github.com/docker/docker/issues/22910

当前版本的Docker客户端(1.11、1.12)以及在新安装中启用的默认凭据存储存在一个错误,这会破坏私有注册表.删除

There exists a bug with current versions of the Docker client (1.11, 1.12), and the default credential stores which are being enabled on new installations, which break private registries. Removing the

"credsStore": "whatever"

Docker配置中的

字段(例如〜/.docker/config.json)并正在运行

field from your docker config (e.g. ~/.docker/config.json) and running

gcloud docker ...

应解决此问题.

更新:

或者,我们已经实现了自己的凭据帮助程序,可以为客户解决问题(即,不会因为Docker缺少GCR URL中的方案而感到困惑客户端用于请求凭据). 要安装凭据帮助器,请执行以下操作:

Alternately, we've implemented a credential helper of our own which solves the problem for our customers (i.e. doesn't get tripped up by the lack of a scheme in the GCR URLs that the Docker client uses to request credentials). To install the credential helper:

  • 下载帮助程序二进制文件并将其放在您的PATH中
    • Download the helper binary and put it on your PATH
      • gcloud components install docker-credential-gcr or
      • download/compile the binary from GitHub

      这篇关于无法推送到Google Container Registry(无法访问存储库)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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