gpt4 book ai didi

docker - 将 JHipster 6.0.1 推送到 Gitlab 存储库

转载 作者:行者123 更新时间:2023-12-02 08:26:49 25 4
gpt4 key购买 nike

在部署一切准备就绪后,我意识到 JHipster 不再有 Dockerfile,并且打包是通过 jib 完成的。生成的 gitlab-ci.yml 有一个 docker-push 阶段,其命令如下:

./mvnw jib:build -Djib.to.image=$IMAGE_TAG -Djib.to.auth.username=gitlab-ci-token  -Djib.to.auth.password=$CI_BUILD_TOKEN

但是失败了

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:0.9.11:build (default-cli) on project test-project: Obtaining project build output files failed; make sure you have compiled your project before trying to build the image. (Did you accidentally run "mvn clean jib:build" instead of "mvn clean compile jib:build"?): /builds/amatos/test-project/target/classes -> [Help 1]

由于失败,我尝试在本地运行命令,如下所示:

./mvnw jib:build -Djib.to.image=registry.gitlab.com/amatos/test-project:v6.0.1 -Djib.to.auth.username=amatos -Djib.to.auth.password=password

但它没有尝试连接到 Gitlab 的注册表,而是尝试连接到 registry.hub.docker.com :

[INFO] Retrieving registry credentials for registry.hub.docker.com...

我想知道的是:如何设置连接到Gitlab而不是Docker Hub?

最佳答案

为了连接到自定义存储库,我将 -Djib.to.image 更改为 -Dimage 并且它起作用了

关于docker - 将 JHipster 6.0.1 推送到 Gitlab 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56334136/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com