Convert convert-gemnasium-maven image to be based on ubi8-micro
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
What does this MR do?
Refactor the Dockerfile file so that the final image is based on ubi8-micro image.
The Dockerfile was refactored so that the final image is based on ubi8-micro instead of ubi8-minimal. A ubi8-minimal
image is used as the build stage.
In the build stage an alternate file system is created at the ARG DNF_INSTALL_ROOT
location. To start with, the entire file system of ubi8-micro is copied in this location:
COPY --from=initial / ${DNF_INSTALL_ROOT}/
This file system is then used as the destination for installing software required in the final image. ARG DNF_OPTS_ROOT
is used to pass options to the dnf
commands, so the software is installed in alternate location(DNF_INSTALL_ROOT
). This location is also used to copy files/directories from local file system and from previous stages as well as for changing file permissions required in the final image.
Once the changes to DNF_INSTALL_ROOT
are completed, this file system is copied to the root of the final image based on ubi8-micro.
Any changes/installations that cannot be done using alternate paths, such as, composer update
, npm install -g yarn
etc. are then done in the final image.
An install.sh
script is also used to install software and run additional commands in the final image. In this MR, the microdnf install/clean
commands are moved out and executed in the build stage while the rest of the script is executed as before.
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer