Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 9ff4188

Browse files
committed
Fix alpine file ownership issues with newer docker
Upgrades to a newer docker version (18.03.1-ce) caused files created inside to be owned by root on alpine. It appears that the logic to set up the user in the container so that this doesn't happen was missing from alpine. While it's not clear why it worked before at all, the logic has been duplicated (tweaked for the alpine base image).
1 parent 9db1b6d commit 9ff4188

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/docker/alpine.3.6/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ FROM microsoft/dotnet-buildtools-prereqs:alpine-3.6-3148f11-20171119021156
99
# This Dockerfile doesn't use the USER_ID, but the parameter needs to be declared to prevent docker
1010
# from issuing a warning
1111
ARG USER_ID=0
12+
RUN adduser code_executor -u ${USER_ID} -G root -D
13+
RUN echo 'code_executor ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
14+
15+
# With the User Change, we need to change permssions on these directories
16+
RUN chmod -R a+rwx /usr/local
17+
RUN chmod -R a+rwx /home
18+
19+
# Set user to the one we just created
20+
USER ${USER_ID}
1221

1322
# Set working directory
1423
WORKDIR /opt/code

0 commit comments

Comments
 (0)