Skip to content

Commit 958a611

Browse files
committed
rename image user as github-actions to resonate with host user
1 parent 20b3397 commit 958a611

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/docker/python-nodejs.Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ RUN true \
99
&& true
1010

1111
# Explicitly set UID/GID to 1001 to match GitHub Runner
12-
RUN groupadd -g 1001 build && \
13-
useradd -m -u 1001 -g 1001 -s /bin/bash build && \
14-
echo "build ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
12+
# this means the github-actions user in the host must have this uid/gid as well
13+
RUN groupadd -g 1001 github-actions && \
14+
useradd -m -u 1001 -g 1001 -s /bin/bash github-actions && \
15+
echo "github-actions ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
1516

16-
WORKDIR /home/build/project
17+
WORKDIR /home/github-actions/project
1718

18-
RUN chown build:build /home/build
19+
RUN chown github-actions:github-actions /home/github-actions
1920

2021
# 4. Switch to the non-root user
21-
USER build
22+
USER github-actions

0 commit comments

Comments
 (0)