Skip to content

Fix ci build docker

Palmer Sébastien requested to merge palmer@functori@fix-ci-build-docker into main

For the moment, the construction of docker images in the CI is as follows:

  • In the sync stage, at each MR, if a docker image does not exist, then it is created from its respective image in main docker-name:main under the name docker-name:branch-name.
  • In the prepare stage, each time an RM branch (or main) is modified with changes in /docker or in the .gitlab-ci-build-docker.yml file, the docker images are played under the name: docker-name:branch-name (resp. docker-name:main).

Several problems then arise:

  • All MRs, which add a new docker image, will fail in sync since their docker image can't be created from main since it doesn't exist.
  • All MRs, which are not modifying docker images, will be forced to use the version of docker images from main at the time of their creation. This implies that:
    • All MRs which target branches which have different docker images to main will fail.
    • Each time a docker image of main changes, all the MRs created before this change (and which do not themselves modify the docker images), will not have these changes after rebasing on main.

To avoid this kind of error, one solution would be to set in the sync stage, for each MR, for each docker image:

  • If the docker image exists for the target branch then the image in its source branch docker-name:source-branch-name is created from its respective image in its target branch docker-name:target-branch-name.
  • Otherwise, if the docker-name:source-branch-name image already exists, nothing is done.
  • Otherwise, the docker-name:source-branch-name image is built.
Edited by Palmer Sébastien

Merge request reports