【问题标题】:Unable to push to Google Container Registry - Bad request无法推送到 Google Container Registry - 错误请求
【发布时间】:2016-07-06 17:51:08
【问题描述】:

推送到“gcr.io”或“us.gcr.io”时遇到问题:

[]# gcloud docker --authorize only
Short-lived access for ['gcr.io', 'us.gcr.io', 'eu.gcr.io', 'asia.gcr.io', 'b.gcr.io', 'bucket.gcr.io', 'appengine.gcr.io'] configured.

[]# docker push gcr.io/tre-dock/pytest
e817ce2379ed: Retrying in 1 seconds
c543d14fcca9: Retrying in 1 seconds
a147e49918ce: Retrying in 3 seconds
063ca6c7c6e9: Retrying in 5 seconds
8f045733649f: Retrying in 7 seconds
unknown: Bad Request.

然而,当我尝试推送到“b.gcr.io”时 - 一切似乎都正常。

我错过了什么?

环境:

[]# gcloud --version
Google Cloud SDK 101.0.0

alpha 2016.01.12
beta 2016.01.12
bq 2.0.24
bq-nix 2.0.18
core 2016.03.11
core-nix 2016.02.05
gcloud
gsutil 4.17
gsutil-nix 4.15
kubectl
kubectl-darwin-x86_64 1.1.7

【问题讨论】:

  • 对于任何人在这里复制/粘贴,它是 --authorize-only 不是 --authorize only

标签: google-cloud-platform gcloud google-container-registry


【解决方案1】:

问题是标签必须包含项目名称:

gcr.io/project_name/tre-dock/pytest

【讨论】:

  • 没错。 GCR 假定主机名之后的第一个元素是项目 ID:gcr.io/$PROJECT_NAME/foo/bar:baz 格式:b.gcr.io 指示 GCR 查找存储桶而不是使用项目名称:b。 gcr.io/$BUCKET_NAME/foo/bar:baz
  • 澄清一下,应该是项目ID还是项目name?在我的情况下,这些似乎有所不同。项目名称是我给它的名字,项目ID是项目名称加上一个数字。
猜你喜欢
  • 2020-04-23
  • 2019-05-29
  • 1970-01-01
  • 1970-01-01
  • 2016-11-12
  • 1970-01-01
  • 2017-11-09
  • 2018-04-22
  • 1970-01-01
相关资源
最近更新 更多