我正在学习https://cloud.google.com/container-builder/docs/quickstart-docker的教程。我已经构建了镜像&它被推送到谷歌的gcr.io注册表。
$ gcloud auth configure-docker
gcloud credential helpers already registered correctly.
$ docker run --init gcr.io/foo-bar-111111/quickstart-image
Unable to find image 'gcr.io/foo-bar-111111/quickstart-image:latest' locally
docker: Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication.
See 'docker run --help'.
$ docker-credential-gcr configure-docker
/home/wonderwoman/.docker/config.json configured to use this credential helper for GCR registries
$ docker run --init gcr.io/foo-bar-111111/quickstart-image
Unable to find image 'gcr.io/foo-bar-111111/quickstart-image:latest' locally
docker: Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication.
See 'docker run --help'.
$ docker pull gcr.io/foo-bar-111111/quickstart-image:latest
Please login prior to pull:
error getting credentials - err: exit status 1, out: `docker-credential-gcr/helper: could not retrieve GCR's access token: credentials not found in native keychain`我错过了什么?
发布于 2018-06-25 02:22:38
您正在将gcloud用作Docker credential helper
gcloud auth configure-docker因此,您必须使用gcloud docker从docker注册表中docker pull您的映像。gcloud docker仍然在底层使用Docker,但在移交给Docker之前,会使用Container Registry凭证注入Docker客户端。
使用您的示例:
gcloud docker pull gcr.io/foo-bar-111111/quickstart-image:latest您可能还必须使用sudo,生成完整的命令:
sudo gcloud docker pull gcr.io/foo-bar-111111/quickstart-image:latesthttps://stackoverflow.com/questions/50769894
复制相似问题