Skip to content

Commit 91134a2

Browse files
fix(docker): pre-install test deps so dnf removal doesn't break test_image.sh (#1627)
`test_image.sh` calls `dnf install` at CI test time, but the `cuopt-final` Dockerfile stage was removing the entire RPM stack (`rpm -e --nodeps dnf rpm curl ...`), leaving no way to install packages at runtime. Remove the rpm-erase block so `dnf` stays in the image. CVE risk from retained packages (`curl`, `dnf`, `rpm`, `python3-libs`) is tracked separately for security approval. Authors: - Ramakrishna Prabhu (https://github.com/ramakrishnap-nv) Approvers: - Trevor McKay (https://github.com/tmckayus) URL: #1627
1 parent c34e4ed commit 91134a2

1 file changed

Lines changed: 3 additions & 28 deletions

File tree

ci/docker/Dockerfile.ubi

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -63,34 +63,9 @@ RUN \
6363

6464
FROM install-env AS cuopt-final
6565

66-
# Remove the entire package-manager stack (dnf, rpm, curl) — the running
67-
# container never needs them. rpm -e --nodeps removes all in one shot.
68-
# Wire python/python3 to python3.14 AFTER the erase so that rpm's %postun
69-
# scriptlets cannot call alternatives --remove and leave the symlinks dangling.
70-
RUN rpm -e --nodeps \
71-
curl \
72-
libcurl-minimal \
73-
dnf \
74-
dnf-data \
75-
python3-dnf \
76-
python3-dnf-plugins-core \
77-
python3-hawkey \
78-
python3-libcomps \
79-
python3-rpm \
80-
python3 \
81-
python3-libs \
82-
libdnf \
83-
libdnf-plugin-subscription-manager \
84-
librepo \
85-
libmodulemd \
86-
libsolv \
87-
rpm-build-libs \
88-
rpm-sign-libs \
89-
rpm-sequoia \
90-
rpm \
91-
rpm-libs \
92-
&& rm -rf /var/lib/rpm /var/lib/dnf /var/cache/dnf /etc/dnf \
93-
&& alternatives --install /usr/bin/python python /usr/bin/python3.14 100 \
66+
# Register python/python3 via alternatives so the system alternatives database
67+
# is consistent with the /usr/bin/python symlink created in install-env.
68+
RUN alternatives --install /usr/bin/python python /usr/bin/python3.14 100 \
9469
&& alternatives --install /usr/bin/python3 python3 /usr/bin/python3.14 100
9570

9671
# On UBI10: libcuopt, cuopt, rapids_logger install to lib64; cuopt_server to lib.

0 commit comments

Comments
 (0)