Skip to content

Commit

Permalink
feat: End Dockerfiles with non-root user
Browse files Browse the repository at this point in the history
Fixes hadolint rule DL3002.
  • Loading branch information
amolenaar committed Sep 11, 2023
1 parent a1ccbfb commit f64c3f0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 1 deletion.
1 change: 0 additions & 1 deletion .hadolint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
failure-threshold: warning
override:
info:
- DL3002
- DL3006
- DL3008
2 changes: 2 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ RUN ln -s "$(which python3.11)" /usr/bin/python && \
python -m venv /opt/.venv && \
chmod -R 777 /opt/.venv/bin/ && \
chmod -R 777 /opt/.venv/lib/python3.11/site-packages

USER techuser
4 changes: 4 additions & 0 deletions capella/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ FROM build_${BUILD_TYPE}

ARG CAPELLA_VERSION

USER root

RUN apt-get update && \
apt-get install -y \
libxtst6 \
Expand Down Expand Up @@ -157,3 +159,5 @@ COPY startup.sh /startup.sh
ENTRYPOINT [ "/tini", "--", "/startup.sh" ]

ENV BASE_TYPE=capella

USER techuser
3 changes: 3 additions & 0 deletions ease/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,7 @@ RUN chmod +rx /etc/git_askpass.py

COPY startup.sh /opt/startup.sh
RUN chmod +x /opt/startup.sh

USER techuser

ENTRYPOINT [ "/opt/startup.sh" ]
2 changes: 2 additions & 0 deletions ease/debug/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ RUN if [ "$NETWORK_ACCESS" = "restricted" ]; then \
fi && \
rm -rf /var/lib/apt/lists/* && \
rm -r /tmp/libs;

USER techuser
2 changes: 2 additions & 0 deletions eclipse/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ ENV ECLIPSE_INSTALLATION_PATH=/opt/eclipse
ENV ECLIPSE_EXECUTABLE=/opt/eclipse/eclipse

ENV BASE_TYPE=eclipse

USER techuser
2 changes: 2 additions & 0 deletions t4c/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@ RUN chown techuser /opt/capella/capella.ini && \
WORKDIR /opt
ENV BASE_TYPE=t4c

USER techuser

ENTRYPOINT [ "/tini", "--", "/docker_entrypoint.sh" ]

0 comments on commit f64c3f0

Please sign in to comment.