在准备好一切部署之后,我意识到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
并开始工作
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句