我正在通过 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/