mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 19:50:30 +00:00
* feat: Add container to propagate host network MTU Some network environments use non-standard MTU values. In these situations, the `DockerMTU` setting might be used to specify the MTU setting for the `bridge` network created by Docker. However, when the Github Actions workflow creates networks, it doesn't propagate the `bridge` network MTU which can lead to `connection reset by peer` messages. To overcome this, I've created a new docker image called `summerwind/actions-runner-mtu` that shims the docker binary in order to propagate the MTU setting to networks created by Github workflows. This is a follow-up on the discussion in (#1046)[https://github.com/actions-runner-controller/actions-runner-controller/issues/1046] and uses a separate image since there might be some unintended side-effects with this approach. * fixup! feat: Add container to propagate host network MTU Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
13 lines
394 B
Bash
Executable File
13 lines
394 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -Eeuo pipefail
|
|
|
|
if [[ ${ARC_DOCKER_MTU_PROPAGATION:-false} == true ]] &&
|
|
(($# >= 2)) && [[ $1 == network && $2 == create ]] &&
|
|
mtu=$(/usr/bin/docker network inspect bridge --format '{{index .Options "com.docker.network.driver.mtu"}}' 2>/dev/null); then
|
|
shift 2
|
|
set -- network create --opt com.docker.network.driver.mtu="$mtu" "$@"
|
|
fi
|
|
|
|
exec /usr/bin/docker "$@"
|