Skip to content

Commit 61c8d5b

Browse files
Refactor: Reduce duplication in Dockerfile.cpu package installation (opendatahub-io#1166)
This commit refactors the conditional package installation logic in runtimes/minimal/ubi9-python-3.11/Dockerfile.cpu to reduce duplication. Common packages (mesa-libGL and skopeo) are now defined in a variable, and architecture-specific packages for s390x are conditionally added to this variable. This improves maintainability and readability of the Dockerfile. This addresses issue opendatahub-io#1161. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent bd044ba commit 61c8d5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runtimes/minimal/ubi9-python-3.11/Dockerfile.cpu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ USER 0
1111
# Install useful OS packages
1212
RUN ARCH=$(uname -m) && \
1313
echo "Detected architecture: $ARCH" && \
14+
PACKAGES="mesa-libGL skopeo" && \
1415
if [ "$ARCH" = "s390x" ]; then \
15-
dnf install -y mesa-libGL skopeo gcc g++ make openssl-devel autoconf automake libtool cmake; \
16-
else \
17-
dnf install -y mesa-libGL skopeo; \
16+
PACKAGES="$PACKAGES gcc g++ make openssl-devel autoconf automake libtool cmake"; \
1817
fi && \
18+
dnf install -y $PACKAGES && \
1919
dnf clean all && rm -rf /var/cache/yum
2020

2121
# Other apps and tools installed as default user

0 commit comments

Comments
 (0)