我想将我的图像推送到谷歌的容器注册表。
我正在使用的命令是(通过 Gitlab Ci 执行,变量正在工作,提前一个阶段对其进行测试):
- mvn compile jib:build -Djib.to.image=$registry
-Djib.to.auth.username=_json_key -Djib.to.auth.password=$googleServiceAccount
服务帐户的权限是“存储对象管理”。
错误:(顺便说一句:Spring Boot 应用程序正在运行 - 在前面的阶段进行测试)
Containerizing application to eu.gcr.io/(project-id), eu.gcr.io/(project-id):version...
[WARNING] Base image 'gcr.io/distroless/java:11' does not use a specific image digest - build may not be reproducible
[INFO] Using credentials from <to><auth> for eu.gcr.io/(project-id)
[INFO] Getting manifest for base image gcr.io/distroless/java:11...
[INFO] Building dependencies layer...
[INFO] Building resources layer...
[INFO] Building classes layer...
[INFO] Using base image with digest: sha256:7fc091e8686df11f7bf0b7f67fd7da9862b2b9a3e49978d1184f0ff62cb673cc
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.432 s
[INFO] Finished at: 2020-09-08T17:20:30Z
[INFO] ------------------------------------------------------------------------
Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.5.2:build (default-cli) on project projektarbeit: Build image failed, perhaps you should make sure your credentials for 'eu.gcr.io/(project-id)' are set up correctly. See https://github.com/GoogleContainerTools/jib/blob/master/docs/faq.md#what-should-i-do-when-the-registry-responds-with-unauthorized for help: Unauthorized for eu.gcr.io/(project-id): 400 Bad Request
[ERROR] {"errors":[{"code":"UNKNOWN","message":"Unable to parse json key."}]}
作为密码,除了json文件之外,我还尝试直接解析以'MIIEv ...'开头的密钥。(没有 \n 和 ---BEGIN/END----)
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQI
我真的希望有人可以帮助我解决这个问题。