Skip to content

Fix provisioning for Docker 23+ for some of the provisioners

Tomasz Maczukin requested to merge 98-fix-ubuntu-provisioning into main

NOTE THAT THIS FORK IS MAINTAINED FOR CRITICAL BUG FIXES AFFECTING RUNNING COSTS ONLY. NO OTHER CONTRIBUTIONS WILL BE ACCEPTED.

What critical bug this MR is fixing?

With Docker 23.0.0 release (which happened today), installation of Docker doesn't create an /etc/docker directory anymore by default. It needs to be done manually.

At the same time, Docker Machine's provisioning for some of the supported distributions assumes that it will be there by default and starts writing key/certificates files into that directory immediately. Which fails with

ERROR: tee: /etc/docker/ca.pem: No such file or directory

Some of the provisioners in the past got a step where this directory is re-created if it's not there. Some of there were missing that. With this MR I'm adding that flow to all of the provisioners:

  • in libmachine/provision/utils.go you can see that a new function that bundles creation of directory with creation of certificates is created,
  • in libmachine/provision/provisioner.go you can see that the Provisioner interface is extended with a new method
  • the rest is updating the provisioners to match the new interface and the new utility function.

How does this change help reduce cost of usage? What scale of cost reduction is it?

In what scenarios is this change usable with GitLab Runner's docker+machine executor?

In any scenario where the target VM is going to use Docker 23.0.0 or newer.

Closes #98 (closed)

Edited by Tomasz Maczukin

Merge request reports