Skip to content

Commit

Permalink
Merge pull request #10 from IBM/feat/non_root
Browse files Browse the repository at this point in the history
wip
  • Loading branch information
LiyangW committed Oct 14, 2022
2 parents 35e5256 + a344b64 commit 8b1ba9b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backwork/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,17 @@ RUN python -m pip install --upgrade pip
RUN pip install setuptools==57.5.0
RUN pip install -r ./requirements.txt

COPY ./docker-entrypoint.sh /
# install sudo as root
RUN apk add --no-cache --update sudo

# add new user
RUN adduser -D myapp \
&& echo "myapp ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/myapp \
&& chmod 0440 /etc/sudoers.d/myapp

COPY --chown=myapp ./docker-entrypoint.sh /
RUN mkdir /backups && chown myapp /backups
USER myapp

VOLUME ["/backups"]
ENTRYPOINT ["/sbin/tini", "--"]
Expand Down

0 comments on commit 8b1ba9b

Please sign in to comment.