Generate Docker images for (and in) the CI
Summary
The simple CI implemented in !12 (merged) uses the centos:7
Docker image as a base for all its jobs. As a consequence, all the required RPM packages must be downloaded and reinstalled in each of the temporary containers. That is a waste of time as resources.
A better solution would be to provide custom Docker image(s) to the GitLab CI runners. These containers could be built, if needed, as part of the CI pipeline. However, such behavior requires careful consideration on the actions to be taken when to update the Docker image(s).
For the master
and develop
branches, the Docker image(s) could be built and pushed to the GitLab container registry only when changes are detected in the container image configuration file. For the MR pipelines this may be more tricky for MR; one doesn't want to rebuilt the image(s) needlessly, but the image(s) need to be rebuilt when required. The MR on-demand Docker image(s) builds might also require to define an expiration policy on the GitLab container registry images.
What is the expected correct behavior?
Downloading and reinstalling all the dependencies in the temporary CI containers . This can, and should, be avoided with a custom Docker image for the GitLab CI worker.
As a byproduct, the Docker image(s) can be used by developers to build the software on an unsupported software stack.