Skip to content

Commit 46b793a

Browse files
committed
Merge remote-tracking branch 'origin/dind-network-host-patch' into dind-network-host-patch-v2.320.0
2 parents 78f2167 + ac9c335 commit 46b793a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

images/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN apt update -y && apt install curl unzip -y
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

src/Runner.Worker/ContainerOperationProvider.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +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]");
100-
102+
*/
103+
var containerNetwork = "host";
104+
executionContext.JobContext.Container["network"] = new StringContextData(containerNetwork);
101105
foreach (var container in containers)
102106
{
103107
container.ContainerNetwork = containerNetwork;
@@ -160,7 +164,8 @@ public async Task StopContainersAsync(IExecutionContext executionContext, object
160164
await StopContainerAsync(executionContext, container);
161165
}
162166
// Remove the container network
163-
await RemoveContainerNetworkAsync(executionContext, containers.First().ContainerNetwork);
167+
// XXX: we're using --network host
168+
//await RemoveContainerNetworkAsync(executionContext, containers.First().ContainerNetwork);
164169
}
165170

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

0 commit comments

Comments
 (0)