Skip to content

Commit b88940f

Browse files
committed
RHAIENG-287: fix(Dockerfiles): use targeted inline suppression to avoid Hadolint DL3002 warning
``` ./jupyter/trustyai/ubi9-python-3.12/Dockerfile.cpu:23 DL3002 warning: Last USER should not be root ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:104 DL3002 warning: Last USER should not be root ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:182 DL3002 warning: Last USER should not be root ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:206 DL3002 warning: Last USER should not be root ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:231 DL3002 warning: Last USER should not be root ./codeserver/ubi9-python-3.12/Dockerfile.cpu:12 DL3002 warning: Last USER should not be root ./codeserver/ubi9-python-3.12/Dockerfile.cpu:38 DL3002 warning: Last USER should not be root ```
1 parent 01e050e commit b88940f

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
1212
# e.g., registry.access.redhat.com/ubi9/python-312:latest
1313
FROM ${BASE_IMAGE} AS rpm-base
1414

15+
# hadolint ignore=DL3002
1516
USER root
1617
WORKDIR /root
1718

@@ -38,6 +39,7 @@ RUN ./get_code_server_rpm.sh && touch /tmp/control
3839
#######################
3940
FROM registry.access.redhat.com/ubi9/python-312:latest AS whl-cache
4041

42+
# hadolint ignore=DL3002
4143
USER root
4244
WORKDIR /root
4345

@@ -287,5 +289,5 @@ set -Eeuxo pipefail
287289
python3 /tmp/test/test_startup.py 2>&1 | tee /tmp/test_log.txt
288290
EOF
289291

290-
from codeserver
292+
FROM codeserver
291293
COPY --from=tests /tmp/test_log.txt /tmp/test_log.txt

jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
118118
FROM cpu-base AS pyarrow-builder
119119

120120
ARG TARGETARCH
121+
# hadolint ignore=DL3002
121122
USER 0
122123
WORKDIR /tmp/build-wheels
123124

@@ -174,6 +175,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
174175
#######################################################
175176
FROM cpu-base AS common-builder
176177
ARG TARGETARCH
178+
# hadolint ignore=DL3002
177179
USER root
178180
RUN <<'EOF'
179181
set -Eeuxo pipefail

jupyter/trustyai/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ RUN cd ./mongodb-cli-mongocli-v${MONGOCLI_VERSION}/ && \
2323
####################
2424
FROM ${BASE_IMAGE} AS whl-cache
2525

26+
# hadolint ignore=DL3002
2627
USER root
2728
ENV HOME=/root
2829
WORKDIR /root

runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ RUN curl -L https://mirror.openshift.com/pub/openshift-v4/$(uname -m)/clients/oc
113113
FROM cpu-base AS s390x-builder
114114

115115
ARG TARGETARCH
116+
# hadolint ignore=DL3002
116117
USER 0
117118
WORKDIR /tmp/build-wheels
118119

@@ -191,6 +192,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
191192
##################################
192193

193194
FROM cpu-base AS openblas-builder
195+
# hadolint ignore=DL3002
194196
USER root
195197
WORKDIR /root
196198

@@ -215,6 +217,7 @@ RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
215217
###################################
216218

217219
FROM cpu-base AS onnx-builder
220+
# hadolint ignore=DL3002
218221
USER root
219222
WORKDIR /root
220223

@@ -241,6 +244,7 @@ RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
241244
##################################
242245

243246
FROM cpu-base AS arrow-builder
247+
# hadolint ignore=DL3002
244248
USER root
245249
WORKDIR /root
246250

0 commit comments

Comments
 (0)