Skip to content

Commit 5404697

Browse files
committed
RHAIENG-287: fix(Dockerfiles): final pass with chatgpt5 to clean up the Hadolint fixes
1 parent 657a366 commit 5404697

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN arch="${TARGETARCH:-$(uname -m)}" && \
2323
arch=$(echo "$arch" | cut -d- -f1) && \
2424
if [ "$arch" = "s390x" ]; then \
2525
echo "Skipping mongocli build for ${arch}, creating dummy binary"; \
26-
mkdir -p /tmp && printf '#!/bin/sh\necho "mongocli not supported on s390x"' > /tmp/mongocli && \
26+
mkdir -p /tmp && printf '#!/bin/sh\necho "mongocli not supported on s390x"\n' > /tmp/mongocli && \
2727
chmod +x /tmp/mongocli; \
2828
else \
2929
echo "Building mongocli for ${arch}"; \
@@ -69,7 +69,8 @@ RUN --mount=type=cache,target=/var/cache/dnf \
6969
dnf install -y $PACKAGES && \
7070
dnf clean all && rm -rf /var/cache/yum
7171

72-
RUN <<EOF
72+
RUN /bin/bash <<'EOF'
73+
set -Eeuxo pipefail
7374
if [ "$TARGETARCH" = "s390x" ]; then
7475
# Install Rust and set up environment
7576
mkdir -p /opt/.cargo
@@ -89,7 +90,8 @@ fi
8990
EOF
9091

9192
# Set python alternatives only for s390x (not needed for other arches)
92-
RUN <<EOF
93+
RUN /bin/bash <<'EOF'
94+
set -Eeuxo pipefail
9395
if [ "$TARGETARCH" = "s390x" ]; then
9496
alternatives --install /usr/bin/python python /usr/bin/python3.12 1
9597
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ RUN --mount=type=cache,target=/var/cache/dnf \
5151
fi
5252

5353
RUN <<EOF
54+
set -Eeuxo pipefail
5455
if [ "$TARGETARCH" = "ppc64le" ]; then cat > /etc/profile.d/ppc64le.sh <<'PROFILE_EOF'
5556
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
5657
export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:$LD_LIBRARY_PATH
@@ -65,6 +66,7 @@ EOF
6566

6667
# For s390x only, set ENV vars and install Rust
6768
RUN <<EOF
69+
set -Eeuxo pipefail
6870
if [ "$TARGETARCH" = "s390x" ]; then
6971
# Install Rust and set up environment
7072
mkdir -p /opt/.cargo
@@ -85,6 +87,7 @@ EOF
8587

8688
# Set python alternatives only for s390x (not needed for other arches)
8789
RUN <<EOF
90+
set -Eeuxo pipefail
8891
if [ "$TARGETARCH" = "s390x" ]; then
8992
alternatives --install /usr/bin/python python /usr/bin/python3.12 1
9093
alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1

0 commit comments

Comments
 (0)