diff --git a/acceptance/testdata/runnerdeploy.yaml b/acceptance/testdata/runnerdeploy.yaml index bff2ce38..66567e8f 100644 --- a/acceptance/testdata/runnerdeploy.yaml +++ b/acceptance/testdata/runnerdeploy.yaml @@ -7,3 +7,14 @@ spec: template: spec: repository: mumoshu/actions-runner-controller-ci + # + # dockerd within runner container + # + ## Replace `mumoshu/actions-runner-dind:dev` with your dind image + #dockerdWithinRunnerContainer: true + #image: mumoshu/actions-runner-dind:dev + + # + # Set the MTU used by dockerd-managed network interfaces (including docker-build) + # + #dockerMTU: 1450 diff --git a/controllers/runner_controller.go b/controllers/runner_controller.go index e5c4fda0..ecc0e22f 100644 --- a/controllers/runner_controller.go +++ b/controllers/runner_controller.go @@ -703,6 +703,7 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) { pod.Spec.Containers = append(pod.Spec.Containers, corev1.Container{ Name: "docker", Image: r.DockerImage, + Args: []string{"dockerd"}, VolumeMounts: []corev1.VolumeMount{ { Name: "work", @@ -731,11 +732,17 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) { if mtu := runner.Spec.DockerMTU; mtu != nil { pod.Spec.Containers[1].Env = append(pod.Spec.Containers[1].Env, []corev1.EnvVar{ + // See https://docs.docker.com/engine/security/rootless/ { Name: "DOCKERD_ROOTLESS_ROOTLESSKIT_MTU", Value: fmt.Sprintf("%d", *runner.Spec.DockerMTU), }, }...) + + pod.Spec.Containers[1].Args = append(pod.Spec.Containers[1].Args, + "--mtu", + fmt.Sprintf("%d", *runner.Spec.DockerMTU), + ) } } diff --git a/runner/startup.sh b/runner/startup.sh index 0fcb1eaa..44a4ddb3 100644 --- a/runner/startup.sh +++ b/runner/startup.sh @@ -17,6 +17,34 @@ function wait_for_process () { return 0 } +sudo /bin/bash <