【发布时间】:2020-01-10 23:37:29
【问题描述】:
我 [相信我] 在我的本地系统和构建系统之间设置了类似的工具和配置。
我可以在本地成功运行它:
$ cat key.json | docker login -u _json_key --password-stdin https://us.gcr.io
WARNING! Your password will be stored unencrypted in /home/local/MAGICLEAP/doprea/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
..但是相同的命令在 GCE 中运行的作业中失败:
cat key.json | docker login -u _json_key --password-stdin https://us.gcr.io
error getting credentials - err: exit status 1, out: `docker-credential-gcr/helper: could not retrieve GCR's access token: metadata: GCE metadata "instance/service-accounts/default/token?scopes=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform" not defined`
似乎真的想在实例元数据中找到令牌,而不仅仅是使用我提供的文件。
我可以参考一些建议。
【问题讨论】:
标签: docker google-compute-engine google-container-registry