使用 Dockers 验证 Google GCP 时出现问题
Problem authenticating Google GCP with Dockers
我需要处理存储在 Google 的 gcr.io 集线器上的一些先前推送的 docker 图像。
我在 Windows 10 机器上执行此操作,标准安装了 Docker 和 Google Cloud SDK(没有 Homebrew 或类似软件)。
在 GCP 的 IAM 部分为我的 gmail 帐户设置权限后,在 PowerShell 中使用它时我仍然收到此错误消息:
docker pull gcr.io/blabla/blabla:latest
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
在重新设置 authentication 时,我收到了这些错误消息
C:\Program Files (x86)\Google\Cloud SDK>gcloud auth configure-docker
WARNING: docker-credential-gcloud
not in system PATH. gcloud's
Docker credential helper can be configured but it will not work until
this is corrected.
WARNING: docker
not in system PATH. docker
and
docker-credential-gcloud
need to be in the same PATH in order to
work correctly together. gcloud's Docker credential helper can be
configured but it will not work until this is corrected.
在搜索解决方案时,我遇到了 ,它似乎使用 macOS 命令。我找到了 Windows 替代 'which' 的方法,即 'where',给出:
C:\Program Files (x86)\Google\Cloud SDK>where gcloud
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd
C:\Users\l.cai\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gcloud
C:\Users\l.cai\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd
但我在理解 this post explaining the alternative for readlink 时遇到了很多困难。用文件路径替换该语法的一部分会给出
' ' is not recognized as an internal or external command
或
The system cannot find the path specified.
多行命令在 Windows PowerShell 或 CMD 中也不能很好地工作,所以我不确定他们在哪里输入命令。
谁能帮我解决这个问题?非常感谢。
您的问题是 gcloud
和 docker
都没有为您登录的用户正确设置。以下是临时解决方案。您应该重新安装 docker 和云 SDK。
验证以下路径的两个组件是否正确并根据您的安装进行调整。
打开 Windows 命令提示符并执行:
set PATH=C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Docker\Docker\Resources\bin;%PATH%
找到解决方案:使用管理员帐户登录 Windows 本身。 None 在我的 OP 中提到的其他 fixes/threads 最终是相关的。
我有一个本地管理员帐户,但由于这是最近设置的,所以我习惯于登录到我常用的工作帐户(非管理员),并且只在需要时输入本地管理员凭据(例如,当 运行 具有提升权限的程序)。
所以 docker 以及 powershell 和 cloud SDK 都可以使用管理员权限单独启动,但是在链的某个地方它中断了,我没有得到任何提示。使用管理员帐户登录可以避免这种情况。
我需要处理存储在 Google 的 gcr.io 集线器上的一些先前推送的 docker 图像。
我在 Windows 10 机器上执行此操作,标准安装了 Docker 和 Google Cloud SDK(没有 Homebrew 或类似软件)。
在 GCP 的 IAM 部分为我的 gmail 帐户设置权限后,在 PowerShell 中使用它时我仍然收到此错误消息:
docker pull gcr.io/blabla/blabla:latest
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
在重新设置 authentication 时,我收到了这些错误消息
C:\Program Files (x86)\Google\Cloud SDK>gcloud auth configure-docker
WARNING:
docker-credential-gcloud
not in system PATH. gcloud's Docker credential helper can be configured but it will not work until this is corrected.WARNING:
docker
not in system PATH.docker
anddocker-credential-gcloud
need to be in the same PATH in order to work correctly together. gcloud's Docker credential helper can be configured but it will not work until this is corrected.
在搜索解决方案时,我遇到了
C:\Program Files (x86)\Google\Cloud SDK>where gcloud
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud
C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd
C:\Users\l.cai\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gcloud
C:\Users\l.cai\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd
但我在理解 this post explaining the alternative for readlink 时遇到了很多困难。用文件路径替换该语法的一部分会给出
' ' is not recognized as an internal or external command
或
The system cannot find the path specified.
多行命令在 Windows PowerShell 或 CMD 中也不能很好地工作,所以我不确定他们在哪里输入命令。
谁能帮我解决这个问题?非常感谢。
您的问题是 gcloud
和 docker
都没有为您登录的用户正确设置。以下是临时解决方案。您应该重新安装 docker 和云 SDK。
验证以下路径的两个组件是否正确并根据您的安装进行调整。
打开 Windows 命令提示符并执行:
set PATH=C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\Docker\Docker\Resources\bin;%PATH%
找到解决方案:使用管理员帐户登录 Windows 本身。 None 在我的 OP 中提到的其他 fixes/threads 最终是相关的。
我有一个本地管理员帐户,但由于这是最近设置的,所以我习惯于登录到我常用的工作帐户(非管理员),并且只在需要时输入本地管理员凭据(例如,当 运行 具有提升权限的程序)。
所以 docker 以及 powershell 和 cloud SDK 都可以使用管理员权限单独启动,但是在链的某个地方它中断了,我没有得到任何提示。使用管理员帐户登录可以避免这种情况。