Compilation in a docker container
Image
In .gitlab-ci.yml
, there is a possibility to
use a docker image.
for your jobs. This is a good practice for reproductibility.
image
requires your GitLab runners to be configured as a Docker executor.
image
can look for your docker images in your GitLab project registry or in
Docker hub.
Exercise
Specify the java_build
docker image as the image
to be used for all jobs in
your .gitlab-ci.yml
file. Go to the GitLab web site in the Registry section
of the project to find the complete image name. You can use the Copy
icon to
avoid typos.
On the GitLab web site, runners are defined for the project in Settings
,
CI / CD
, expand the Runners
. The runners with the tags linux
are
using shell executors. The runners with the tags ci.inria.fr
are using
docker executors. Modify your .gitlab-ci.yml
file to use ci.inria.fr
tags.
Commit and push your .gitlab-ci.yml
file to verify it compiles.
Home | Java Home | << Java Previous - Code to cover | >> Java Next - Manual deployment