Skip to content

Commit

Permalink
Add docker cli to the runner image. (#2425)
Browse files Browse the repository at this point in the history
  • Loading branch information
TingluoHuang authored Feb 8, 2023
1 parent 67356a3 commit 6d1d246
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM mcr.microsoft.com/dotnet/runtime-deps:6.0 as build
ARG RUNNER_VERSION
ARG RUNNER_ARCH="x64"
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.2.0
ARG DOCKER_VERSION=20.10.23

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

Expand All @@ -15,6 +16,12 @@ RUN curl -f -L -o runner-container-hooks.zip https://github.com/actions/runner-c
&& unzip ./runner-container-hooks.zip -d ./k8s \
&& rm runner-container-hooks.zip

RUN export DOCKER_ARCH=x86_64 \
&& if [ "$RUNNER_ARCH" = "arm64" ]; then export DOCKER_ARCH=aarch64 ; fi \
&& curl -fLo docker.tgz https://download.docker.com/linux/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz \
&& tar zxvf docker.tgz \
&& rm -rf docker.tgz

FROM mcr.microsoft.com/dotnet/runtime-deps:6.0

ENV RUNNER_ALLOW_RUNASROOT=1
Expand All @@ -23,3 +30,5 @@ ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1

WORKDIR /actions-runner
COPY --from=build /actions-runner .

RUN install -o root -g root -m 755 docker/* /usr/bin/ && rm -rf docker

0 comments on commit 6d1d246

Please sign in to comment.