Skip to content

Commit 8b1ba9b

Browse files
authored
Merge pull request #10 from IBM/feat/non_root
wip
2 parents 35e5256 + a344b64 commit 8b1ba9b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

backwork/Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ RUN python -m pip install --upgrade pip
3535
RUN pip install setuptools==57.5.0
3636
RUN pip install -r ./requirements.txt
3737

38-
COPY ./docker-entrypoint.sh /
38+
# install sudo as root
39+
RUN apk add --no-cache --update sudo
40+
41+
# add new user
42+
RUN adduser -D myapp \
43+
&& echo "myapp ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/myapp \
44+
&& chmod 0440 /etc/sudoers.d/myapp
45+
46+
COPY --chown=myapp ./docker-entrypoint.sh /
47+
RUN mkdir /backups && chown myapp /backups
48+
USER myapp
3949

4050
VOLUME ["/backups"]
4151
ENTRYPOINT ["/sbin/tini", "--"]

0 commit comments

Comments
 (0)