feat: Add container to propagate host network MTU (#1201)

* 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>
This commit is contained in:
Tiago Melo
2022-09-23 09:08:28 +01:00
committed by GitHub
parent 8f54644b08
commit e7a21cfc53
6 changed files with 48 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
DOCKER_USER ?= summerwind
DOCKER ?= docker
NAME ?= ${DOCKER_USER}/actions-runner
DIND_RUNNER_NAME ?= ${DOCKER_USER}/actions-runner-dind
TAG ?= latest
@@ -26,14 +27,14 @@ else
endif
docker-build-ubuntu:
docker build \
${DOCKER} build \
--build-arg TARGETPLATFORM=${TARGETPLATFORM} \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
--build-arg RUNNER_CONTAINER_HOOKS_VERSION=${RUNNER_CONTAINER_HOOKS_VERSION} \
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
-f actions-runner.dockerfile \
-t ${NAME}:${TAG} .
docker build \
${DOCKER} build \
--build-arg TARGETPLATFORM=${TARGETPLATFORM} \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
@@ -41,8 +42,8 @@ docker-build-ubuntu:
-t ${DIND_RUNNER_NAME}:${TAG} .
docker-push-ubuntu:
docker push ${NAME}:${TAG}
docker push ${DIND_RUNNER_NAME}:${TAG}
${DOCKER} push ${NAME}:${TAG}
${DOCKER} push ${DIND_RUNNER_NAME}:${TAG}
docker-buildx-ubuntu:
export DOCKER_CLI_EXPERIMENTAL=enabled ;\
@@ -50,14 +51,14 @@ docker-buildx-ubuntu:
@if ! docker buildx ls | grep -q container-builder; then\
docker buildx create --platform ${PLATFORMS} --name container-builder --use;\
fi
docker buildx build --platform ${PLATFORMS} \
${DOCKER} buildx build --platform ${PLATFORMS} \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
--build-arg RUNNER_CONTAINER_HOOKS_VERSION=${RUNNER_CONTAINER_HOOKS_VERSION} \
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \
-f actions-runner.dockerfile \
-t "${NAME}:${TAG}" \
. ${PUSH_ARG}
docker buildx build --platform ${PLATFORMS} \
${DOCKER} buildx build --platform ${PLATFORMS} \
--build-arg RUNNER_VERSION=${RUNNER_VERSION} \
--build-arg RUNNER_CONTAINER_HOOKS_VERSION=${RUNNER_CONTAINER_HOOKS_VERSION} \
--build-arg DOCKER_VERSION=${DOCKER_VERSION} \