google-cloud-platform - 通过 jenkins 推送 docker 镜像

标签 google-cloud-platform jenkins-pipeline

我正在通过 Jenkins 管道推送 docker 镜像,但出现以下错误:

ERROR: Could not find credentials matching gcr:["google-container-registry"]

我试过:

gcr:["google-container-registry"]
gcr:[google-container-registry]
gcr:google-container-registry
google-container-registry

但它们都不起作用。

在我拥有的全局证书中:

NAME: google-container-registry

KIND: Google Service Account from private key

DESCRIPTION: A Google robot account for accessing Google APIs and services.

最佳答案

正确的语法如下(前提是您的 gcr 凭证 ID 是“google-container-registry”):

docker.withRegistry("https://gcr.io", "gcr:google-container-registry") {
  sh "docker push [your_image]"
}

关于google-cloud-platform - 通过 jenkins 推送 docker 镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54573068/

相关文章:

python - 无法读取上传到谷歌云存储桶的 csv 文件

jenkins - 如何动态地将credentialsId传递给Jenkins管道

jenkins - 使用 Jenkins 管道多行/多行字符串参数

jenkins - 在流水线 SH 脚本中使用 Jenkins 环境变量

python - 如何在 jenkins 管道的 docker 容器中运行 python 脚本

Jenkins Groovy 管道 - git checkout 错误

google-cloud-platform - 浏览器在模型训练期间断开连接

android - 如何为 Firebase (Kotlin) 创建自定义身份验证

javascript - npm 错误!无效版本 : "1"

python-2.7 - 如何使用Python脚本将对象上传到Google Cloud Storage?