Consistent use of UID of dind-rootless runner

There are some consistency issues in the dind-rootless runner image
that leads to some confusion on what exactly the UID of the runner is.

To stay consistent use the same UID everywhere.
This commit is contained in:
Zoltán Reegn 2024-05-21 22:27:43 +02:00
parent c8e3bb5ec3
commit dc239f5ef4
1 changed files with 5 additions and 5 deletions

View File

@ -78,9 +78,9 @@ RUN cd "$RUNNER_ASSETS_DIR" \
&& rm -f runner-container-hooks.zip
# Make the rootless runner directory executable
RUN mkdir /run/user/1000 \
&& chown runner:runner /run/user/1000 \
&& chmod a+x /run/user/1000
RUN mkdir /run/user/$RUNNER_USER_UID \
&& chown runner:runner /run/user/$RUNNER_USER_UID \
&& chmod a+x /run/user/$RUNNER_USER_UID
# We place the scripts in `/usr/bin` so that users who extend this image can
# override them with scripts of the same name placed in `/usr/local/bin`.
@ -97,8 +97,8 @@ COPY hooks /etc/arc/hooks/
# Add the Python "User Script Directory" to the PATH
ENV PATH="${PATH}:${HOME}/.local/bin:/home/runner/bin"
ENV ImageOS=ubuntu22
ENV DOCKER_HOST=unix:///run/user/1000/docker.sock
ENV XDG_RUNTIME_DIR=/run/user/1000
ENV DOCKER_HOST=unix:///run/user/$RUNNER_USER_UID/docker.sock
ENV XDG_RUNTIME_DIR=/run/user/$RUNNER_USER_UID
RUN echo "PATH=${PATH}" > /etc/environment \
&& echo "ImageOS=${ImageOS}" >> /etc/environment \