I am using Jib to create a docker container and push it to the registry. To do that, I would like to build a Docker image that can be used for the purpose of container scanning before pushing the image to the Gitlab registry. The issue I am facing is I cannot use maven
docker image for the build as it doesn't have docker agent running. I cannot use docker
image as it doesn't have the maven image. Is there any way to address this without creating a custom docker image?
Here is my .gitlab-ci.yml
file related to this part:
Building:
image: docker:19.03.1 # or maven:3-jdk-8
stage: build
only:
- master
script:
- echo "Building the project"
- mvn compile jib:dockerBuild
In case of docker image:
/bin/sh: eval: line 91: mvn: not found
In case of maven image:
Build to Docker daemon failed, perhaps you should make sure Docker is installed and you have correct privileges to run it