Trouble in generate image with JIB and push with docker on GitLab CI

  docker, gitlab, java, jib

I’m trying to generate an image with the JIB and push this image with Docker on Gitlab CI, but I’m having trouble with it.

I know that JIB can push for the registry itself, but my company registry url is not following the right pattern for JIB.

This is my .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

There’s the following output from the job:

[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
...

Source: Docker Questions

LEAVE A COMMENT