Skip to content

Add support for docker client version negotiation

What does this MR do?

Changes the docker client from using a static and older API version, to instead supporting version negotiation.

Version negotiation was introduced in with API version 1.25, which also happens to be the minimum version we were supporting.

Why was this MR needed?

Some API endpoints we use (such as ContainerWait()) use legacy code paths if a recent API version isn't used. It's probably always in our best interest to use the latest, providing that there's a way for a user to specify the version they want.

What's the best way to test this MR?

Running with gitlab-runner --debug run should print the message when recieving a job and connecting to the docker daemon.

Connected to docker daemon (api version: 1.41, server version: 20.10.5, kernel: 5.10.25-linuxkit, os: linux/x86_64)

Running with DOCKER_API_VERSION=1.25 gitlab-runner --debug run should print the message:

Connected to docker daemon (api version: 1.25, server version: 20.10.5, kernel: 5.10.25-linuxkit, os: linux/x86_64)

What are the relevant issue numbers?

Closes #28890 (closed)

Edited by Arran Walker

Merge request reports