Skip to content

Commit

Permalink
Change runner image to make user/folder align with ubuntu-latest host…
Browse files Browse the repository at this point in the history
…ed runner. (#2469)
  • Loading branch information
TingluoHuang authored Mar 2, 2023
1 parent 542e8a3 commit d61b27b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,26 @@ RUN export DOCKER_ARCH=x86_64 \

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

ENV RUNNER_ALLOW_RUNASROOT=1
ENV DEBIAN_FRONTEND=noninteractive
ENV RUNNER_MANUALLY_TRAP_SIG=1
ENV ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT=1

WORKDIR /actions-runner
COPY --from=build /actions-runner .
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
sudo \
&& rm -rf /var/lib/apt/lists/*

RUN adduser --disabled-password --gecos "" --uid 1001 runner \
&& groupadd docker --gid 123 \
&& usermod -aG sudo runner \
&& usermod -aG docker runner \
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers

WORKDIR /home/runner

COPY --chown=runner:docker --from=build /actions-runner .

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

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

0 comments on commit d61b27b

Please sign in to comment.