【问题标题】:gcloud crash while requesting a build (Google Container Builder) from Bitbucket pipelines从 Bitbucket 管道请求构建(Google Container Builder)时 gcloud 崩溃
【发布时间】:2017-02-16 12:53:53
【问题描述】:

我们使用 bitbucket 托管 git repo 并开始使用管道进行测试,但现在我正在考虑下一步,部署。

我想利用 Google Container Builder 并从管道中触发它。有一个Dockerfile 位于kubernetes/nginx/,应该发送到Google Container Builder。

当我在本地运行以下命令时,它可以完美运行:

gcloud container builds submit --tag gcr.io/$PROJECT_ID/website/nginx kubernetes/nginx/

但作为管道的一部分,我收到以下错误:

错误:gcloud 崩溃(AttributeError):“NoneType”对象没有“替换”属性

gcloud 版本:

Google Cloud SDK 143.0.1
bq 2.0.24
bq-nix 2.0.24
core 2017.02.09
core-nix 2017.02.09
gcloud 
gcloud-deps 2017.02.09
gcloud-deps-linux-x86_64 
gsutil 4.22
gsutil-nix 4.22
kubectl 
kubectl-linux-x86_64 1.5.2

我检查过的东西:

  • 我的身份验证正确,所以这不是问题。
  • 我还验证了构建所需的文件是可访问的。

【问题讨论】:

  • 你有没有 .dockerignore 文件?
  • 是的,我有 @JasonHall,但这不是问题 :)
  • 我们发现了这个错误,它将在下一个 gcloud 版本中修复。谢谢! :)

标签: gcloud google-container-registry bitbucket-pipelines


【解决方案1】:

我在构建请求之前添加了以下命令:

gcloud config set compute/zone europe-west1-d
gcloud config set project *Project id here*

添加后它起作用了,所以我认为问题在于无法访问区域或项目数据。

【讨论】:

  • 谢谢,这确实是一个正确的解决方法。核心问题是源代码中的一个错误,我现在将修复它。
  • 通过搜索相同的错误消息来到这里。我想使用命令gcloud container images list-tags ... 在 CI 管道中列出我的容器映像,并得到了同样的错误。这里建议的两个配置设置并没有解决我的问题,但是在 list-tags 之前运行 gcloud projects list 命令。奇怪 :) 我使用的是 google/cloud-sdk:apline docker 镜像:
     gcloud version Google Cloud SDK 224.0.0 bq 2.0.36 core 2018.11.02 gsutil 4.34 
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-14
  • 1970-01-01
  • 2022-12-19
  • 1970-01-01
  • 2020-11-21
  • 1970-01-01
相关资源
最近更新 更多