Skip to content

Commit 48d7c14

Browse files
committed
dind-network-host patch
1 parent 70746ff commit 48d7c14

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

Diff for: images/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ ARG TARGETARCH
66
ARG RUNNER_VERSION
77
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.6.1
88
ARG DOCKER_VERSION=25.0.5
9-
ARG BUILDX_VERSION=0.13.2
9+
ARG BUILDX_VERSION=0.14.1
1010

1111
RUN apt update -y && apt install curl unzip -y
1212

1313
WORKDIR /actions-runner
1414
RUN export RUNNER_ARCH=${TARGETARCH} \
1515
&& if [ "$RUNNER_ARCH" = "amd64" ]; then export RUNNER_ARCH=x64 ; fi \
16-
&& curl -f -L -o runner.tar.gz https://github.com/actions/runner/releases/download/v${RUNNER_VERSION}/actions-runner-${TARGETOS}-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz \
16+
&& curl -f -L -o runner.tar.gz https://github.com/dfinity/runner/releases/download/v${RUNNER_VERSION}/actions-runner-${TARGETOS}-${RUNNER_ARCH}-${RUNNER_VERSION}.tar.gz \
1717
&& tar xzf ./runner.tar.gz \
1818
&& rm runner.tar.gz
1919

Diff for: releaseVersion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<Update to ./src/runnerversion when creating release>
1+
2.317.0-hostnetwork

Diff for: src/Runner.Worker/ContainerOperationProvider.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,16 @@ public async Task StartContainersAsync(IExecutionContext executionContext, objec
9292

9393
// Create local docker network for this job to avoid port conflict when multiple runners run on same machine.
9494
// All containers within a job join the same network
95+
/*
96+
XXX: don't add network as we'll use --network host
9597
executionContext.Output("##[group]Create local container network");
9698
var containerNetwork = $"github_network_{Guid.NewGuid().ToString("N")}";
9799
await CreateContainerNetworkAsync(executionContext, containerNetwork);
98100
executionContext.JobContext.Container["network"] = new StringContextData(containerNetwork);
99101
executionContext.Output("##[endgroup]");
102+
*/
103+
var containerNetwork = "host";
104+
executionContext.JobContext.Container["network"] = new StringContextData(containerNetwork);
100105

101106
foreach (var container in containers)
102107
{
@@ -160,7 +165,8 @@ public async Task StopContainersAsync(IExecutionContext executionContext, object
160165
await StopContainerAsync(executionContext, container);
161166
}
162167
// Remove the container network
163-
await RemoveContainerNetworkAsync(executionContext, containers.First().ContainerNetwork);
168+
// XXX: we're using --network host
169+
//await RemoveContainerNetworkAsync(executionContext, containers.First().ContainerNetwork);
164170
}
165171

166172
private async Task StartContainerAsync(IExecutionContext executionContext, ContainerInfo container)

Diff for: src/runnerversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.317.0
1+
2.317.0-hostnetwork

0 commit comments

Comments
 (0)