我正在尝试使用 JIB 生成图像并在 Gitlab CI 上使用 Docker 推送此图像,但我遇到了问题。
我知道 JIB 可以推送注册表本身,但我的公司注册表 url 没有遵循 JIB 的正确模式。
这是我的 .gitlab-ci.yml
image: docker:latest
services:
- docker:dind
stages:
- build
- docker
variables:
QUARKUS_PORT: 8080
build_test:
image: adoptopenjdk/openjdk15:jre-15.0.1_9-alpine
stage: build
script:
- ./mvnw -Dquarkus.container-image.build=true clean package
docker:
image:
stage: docker
script: docker push my_registry.example.com
作业有以下输出:
[ERROR] [error]: Build step io.quarkus.container.image.jib.deployment.JibProcessor#buildFromJar threw an exception: java.lang.RuntimeException: Unable to create container image
...
[ERROR] Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
...
[ERROR] Caused by: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
...
[ERROR] Caused by: java.io.IOException: error=2, No such file or directory
...