Skip to content

Commit d42e2a3

Browse files
authored
RHAIENG-287: fix(Dockerfiles): use explicit /bin/bash RUN blocks to avoid Hadolint SC3041 warning (#2563)
``` ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:53 SC3041 warning: In POSIX sh, set flag -E is undefined. ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:68 SC3041 warning: In POSIX sh, set flag -E is undefined. ./runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu:89 SC3041 warning: In POSIX sh, set flag -E is undefined. ``` # Fix hadolint SC3041 in datascience runtime Dockerfile ## Approach - Replace POSIX heredoc invocations with explicit bash heredocs to make `set -E` valid, following patterns already used in `jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu`. - Use a quoted delimiter to prevent Docker-time expansion while still allowing bash to expand variables at runtime. ## Targeted edits - In `runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu`, change these RUN blocks: ```53:66:/Users/jdanek/IdeaProjects/notebooks/runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu RUN <<EOF set -Eeuxo pipefail # ... EOF ``` to: ```53:66:/Users/jdanek/IdeaProjects/notebooks/runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu RUN /bin/bash <<'EOF' set -Eeuxo pipefail # ... EOF ``` Similarly update the other two blocks: ```67:86:/Users/jdanek/IdeaProjects/notebooks/runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu RUN <<EOF set -Eeuxo pipefail # ... EOF ``` → ```67:86:/Users/jdanek/IdeaProjects/notebooks/runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu RUN /bin/bash <<'EOF' set -Eeuxo pipefail # ... EOF ``` ```88:96:/Users/jdanek/IdeaProjects/notebooks/runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu RUN <<EOF set -Eeuxo pipefail # ... EOF ``` → ```88:96:/Users/jdanek/IdeaProjects/notebooks/runtimes/datascience/ubi9-python-3.12/Dockerfile.cpu RUN /bin/bash <<'EOF' set -Eeuxo pipefail # ... EOF ``` ## Notes - This mirrors existing usage in `jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu` (e.g., lines with `RUN /bin/bash <<'EOF'`). - No changes to the script bodies; only the heredoc invocations are updated.
1 parent 7db0feb commit d42e2a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ RUN --mount=type=cache,target=/var/cache/dnf \
5050
dnf clean all && rm -rf /var/cache/yum; \
5151
fi
5252

53-
RUN <<EOF
53+
RUN /bin/bash <<'EOF'
5454
set -Eeuxo pipefail
5555
if [ "$TARGETARCH" = "ppc64le" ]; then cat > /etc/profile.d/ppc64le.sh <<'PROFILE_EOF'
5656
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
@@ -65,7 +65,7 @@ fi
6565
EOF
6666

6767
# For s390x only, set ENV vars and install Rust
68-
RUN <<EOF
68+
RUN /bin/bash <<'EOF'
6969
set -Eeuxo pipefail
7070
if [ "$TARGETARCH" = "s390x" ]; then
7171
# Install Rust and set up environment
@@ -86,7 +86,7 @@ fi
8686
EOF
8787

8888
# Set python alternatives only for s390x (not needed for other arches)
89-
RUN <<EOF
89+
RUN /bin/bash <<'EOF'
9090
set -Eeuxo pipefail
9191
if [ "$TARGETARCH" = "s390x" ]; then
9292
alternatives --install /usr/bin/python python /usr/bin/python3.12 1

0 commit comments

Comments
 (0)