Skip to content

Commit a659643

Browse files
committed
fix(dockerfile): set more lenient permissions on /home/runner
Currently, the permissions of /home/runner are 750. In some container runtimes and Kubernetes distributions (including OpenShift), a different uid/gid (not `runner`) may be used when running the image. The runner expects to be able to read and execute scripts within the home directory, and it will also write ephemeral files, diagnostic data, etc. into the directory as well. Therefore, to support the ability to use the runner as a user apart from `runner`, full 777 permissions are needed. A longer-term change to consider which may improve the security posture here would be to separate the executable portions of the application (scripts, etc.) from the places where temporary data is written, and control the permissions of these separately. Signed-off-by: Caleb Xu <caxu@redhat.com>
1 parent 0b2c71f commit a659643

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

images/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ RUN adduser --disabled-password --gecos "" --uid 1001 runner \
5959
&& usermod -aG sudo runner \
6060
&& usermod -aG docker runner \
6161
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers \
62-
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers
62+
&& echo "Defaults env_keep += \"DEBIAN_FRONTEND\"" >> /etc/sudoers \
63+
&& chmod 777 /home/runner
6364

6465
WORKDIR /home/runner
6566

0 commit comments

Comments
 (0)