GitLab CI: Build the image from a Dockerfile, post that image to GitLab, and use it for all the jobs in yaml

Issue #31 resolved
Mihai Nita created an issue

So the Dockerfile can do all the apt-get, tools install and configurations.

Pros: Would be easier to test locally (build docker from Dockerfile and run things in it)

Now if I want to play with the image I have to change the yaml, push, and then fails in GitLab because I had a typo. Or the gpg import command was not quite right. Or I make a Dockerfile locally, check that it works, then copy the commands from the Dockerfile to the yaml config, including the change of syntax (RUN foo in Dockerfile becomes script: - foo in yaml, etc.)

Also reduces the scripts to keep in sync. We create one image and we build everything with it. Otherwise we need to keep in sync between Okapi, Xliff Toolkit, Integration, maybe in the future Reports, builds with Java 8 and 11 ...

Cons: Harder to publish (you have to do it locally, then publish it to the GitLab registry) Not too hard, but still... I did it yesterday.

Basically you do a docker login registry.gitlab.com then the normal docker build and docker run until it all works the way you want, and in the end you do a docker push

The login and push are the only extras compared to working with Docker locally.

Comments (3)

  1. Log in to comment