From 3df5c582bcfc4f9a042bf88e08d5ef08712216a1 Mon Sep 17 00:00:00 2001 From: Jesse Dohmann Date: Wed, 11 Sep 2024 11:56:05 -0700 Subject: [PATCH] OSDOCS-11352: update examples with dnf --- .../mco-coreos-layering.adoc | 20 ++++++++++--------- modules/coreos-layering-configuring-on.adoc | 7 ++++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/machine_configuration/mco-coreos-layering.adoc b/machine_configuration/mco-coreos-layering.adoc index ebeba04e46..55f15e689c 100644 --- a/machine_configuration/mco-coreos-layering.adoc +++ b/machine_configuration/mco-coreos-layering.adoc @@ -60,24 +60,24 @@ Hotfixes are provided to you based on link:https://access.redhat.com/solutions/2 .Example on-cluster Containerfile to apply a Hotfix [source,yaml] ---- -# Using a 4.12.0 image +# Using a 4.17.0 image containerfileArch: noarch content: |- FROM configs AS final #Install hotfix rpm - RUN rpm-ostree override replace https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \ - rpm-ostree cleanup -m && \ + RUN dnf install -y https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \ + dnf clean all && \ ostree container commit ---- + .Example out-of-cluster Containerfile to apply a Hotfix [source,yaml] ---- -# Using a 4.12.0 image +# Using a 4.17.0 image FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256... #Install hotfix rpm -RUN rpm-ostree override replace https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \ - rpm-ostree cleanup -m && \ +RUN dnf install -y https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \ + dnf clean all && \ ostree container commit ---- @@ -107,8 +107,9 @@ Because libreswan requires additional {op-system-base} packages, the image must FROM configs AS final #Enable EPEL (more info at https://docs.fedoraproject.org/en-US/epel/ ) and install htop -RUN rpm-ostree install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ - rpm-ostree install htop && \ +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ + dnf install -y htop && \ + dnf clean all && \ ostree container commit ---- + @@ -127,7 +128,8 @@ FROM configs AS final # RHEL entitled host is needed here to access RHEL packages # Install fish as third party package from EPEL -RUN rpm-ostree install https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/f/fish-3.3.1-3.el9.x86_64.rpm && \ +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/f/fish-3.3.1-3.el9.x86_64.rpm && \ + dnf clean all && \ ostree container commit ---- + diff --git a/modules/coreos-layering-configuring-on.adoc b/modules/coreos-layering-configuring-on.adoc index 47c11b0b7d..e3aed75860 100644 --- a/modules/coreos-layering-configuring-on.adoc +++ b/modules/coreos-layering-configuring-on.adoc @@ -6,7 +6,7 @@ [id="coreos-layering-configuring-on_{context}"] = Using on-cluster layering to apply a custom layered image -To apply a custom layered image to your cluster by using the on-cluster build process, make a `MachineOSConfig` custom resource that includes a Containerfile, a machine config pool reference, repository push and pull secrets, and other parameters as described in the prerequisites. +To apply a custom layered image to your cluster by using the on-cluster build process, make a `MachineOSConfig` custom resource that includes a Containerfile, a machine config pool reference, repository push and pull secrets, and other parameters as described in the prerequisites. When you create the object, the Machine Config Operator (MCO) creates a `MachineOSBuild` object and a `machine-os-builder` pod. The build process also creates transient objects, such as config maps, which are cleaned up after the build is complete. @@ -53,8 +53,9 @@ spec: - containerfileArch: noarch content: |- FROM configs AS final - RUN rpm-ostree install cowsay && \ - ostree container commit + RUN dnf install -y cowsay && \ + dnf clean all && \ + ostree container commit imageBuilder: # <3> imageBuilderType: PodImageBuilder baseImagePullSecret: # <4>