Skip to content

Commit 6aee255

Browse files
Merge pull request #2803 from dlom/HIVE-2984-pre
ARGify dnf in the Dockerfile
2 parents 6b7bd63 + 1ba6ffe commit 6aee255

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,23 @@ RUN make build-hiveadmission build-manager build-operator && \
3737
FROM ${BASE_IMAGE}
3838
ARG CONTAINER_SUB_MANAGER_OFF
3939
ENV SMDEV_CONTAINER_OFF=${CONTAINER_SUB_MANAGER_OFF}
40+
ARG DNF=dnf
4041

4142
# CVE-2023-6597
42-
RUN dnf upgrade -y python3
43+
RUN ${DNF} upgrade -y python3
4344

4445
RUN if [ -e "/activation-key/org" ]; then unlink /etc/rhsm-host; subscription-manager register --force --org $(cat "/activation-key/org") --activationkey $(cat "/activation-key/activationkey"); fi
4546

4647

4748
##
4849
# ssh-agent required for gathering logs in some situations:
49-
RUN if ! rpm -q openssh-clients; then dnf install -y openssh-clients && dnf clean all && rm -rf /var/cache/dnf/*; fi
50+
RUN if ! rpm -q openssh-clients; then ${DNF} install -y openssh-clients && ${DNF} clean all && rm -rf /var/cache/dnf/*; fi
5051

5152
# libvirt libraries required for running bare metal installer.
52-
RUN if ! rpm -q libvirt-libs; then dnf install -y libvirt-libs && dnf clean all && rm -rf /var/cache/dnf/*; fi
53+
RUN if ! rpm -q libvirt-libs; then ${DNF} install -y libvirt-libs && ${DNF} clean all && rm -rf /var/cache/dnf/*; fi
5354

5455
# tar is needed to package must-gathers on install failure
55-
RUN if ! command -v tar; then dnf install -y tar && dnf clean all && rm -rf /var/cache/dnf/*; fi
56+
RUN if ! command -v tar; then ${DNF} install -y tar && ${DNF} clean all && rm -rf /var/cache/dnf/*; fi
5657

5758
COPY --from=builder_rhel9 /go/src/github.com/openshift/hive/bin/manager /opt/services/
5859
COPY --from=builder_rhel9 /go/src/github.com/openshift/hive/bin/hiveadmission /opt/services/

0 commit comments

Comments
 (0)