Skip to content

Enable configuration of MTU in Docker executor

What does this MR do?

This merge request introduces an additional setting for the Docker executor, called network_mtu which sets the network MTU in combination with FF_NETWORK_PER_BUILD.

Why was this MR needed?

Several environments like e.g. OpenStack might set a lower MTU than the default 1500. As of today, there's no configuration to instruct the Docker daemon itself a custom MTU for networks. The value mtu in the daemon.json is ignored. There's an ongoing issue in the Moby project, but right now, it's still open. It's unclear whether and when the related Pull Request might get merged.

What's the best way to test this MR?

  1. Create a VM in a network with a lower MTU than 1500.
  2. Install the GitLab runner on it.
  3. Set the network_mtu in the [runners.docker] section to the correct MTU.
  4. Execute a simple pipeline with the custom setting.

Example for a pipeline:

stages:
- build

build:
  image: alpine
  variables:
    FF_NETWORK_PER_BUILD: true
  before_script:
    - apk add curl
  script:
    - curl https://repo.maven.apache.org/maven2/org/codehaus/mojo/versions-maven-plugin/2.8.1/versions-maven-plugin-2.8.1.pom

I've tested the variable in our setup that has the above restrictions and it worked as expected.

What are the relevant issue numbers?

Closes #28960 (closed)

Edited by Axel von Bertoldi

Merge request reports