Parcourir la source

finally nailed ocp entitled builds

Grega Bremec il y a 2 ans
Parent
commit
fd37ffaed3
2 fichiers modifiés avec 8 ajouts et 2 suppressions
  1. 4 1
      images/Containerfile-psacct
  2. 4 1
      images/Containerfile-sysstat

+ 4 - 1
images/Containerfile-psacct

@@ -4,7 +4,10 @@ USER 0
 
 COPY entrypoint-psacct.sh /usr/local/bin/entrypoint.sh
 
-RUN microdnf -y install psacct && \
+# This still applies: delete host RHSM data in OpenShift
+# Twist: if there is no host entitlement, remove host RHSM data.
+RUN [ -d /etc/pki/entitlement-host ] || rm -f /etc/rhsm-host ; \
+    microdnf -y install psacct && \
     rm -rf /var/lib/dnf /var/cache/dnf /var/cache/cups /var/cache/PackageKit && \
     chmod 755 /usr/local/bin/entrypoint.sh
 

+ 4 - 1
images/Containerfile-sysstat

@@ -4,7 +4,10 @@ USER 0
 
 COPY entrypoint-sysstat.sh /usr/local/bin/entrypoint.sh
 
-RUN microdnf -y install sysstat && \
+# This still applies: delete host RHSM data in OpenShift
+# Twist: if there is no host entitlement, remove host RHSM data.
+RUN [ -d /etc/pki/entitlement-host ] || rm -f /etc/rhsm-host ; \
+    microdnf -y install sysstat && \
     rm -rf /var/lib/dnf /var/cache/dnf /var/cache/cups /var/cache/PackageKit && \
     chmod 755 /usr/local/bin/entrypoint.sh