Skip to content

Commit 288d4c6

Browse files
authored
Merge pull request #84641 from jldohmann/OSDOCS-12604
OSDOCS-12604: inline containerfiles and update with dnf
2 parents eade8c2 + c7658bd commit 288d4c6

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

machine_configuration/mco-coreos-layering.adoc

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,21 @@ RUN dnf install -y https://example.com/myrepo/haproxy-1.0.16-5.el8.src.rpm && \
8484
* *{op-system-base} packages*. You can download {op-system-base-full} packages from the link:https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.1/x86_64/packages[Red Hat Customer Portal], such as chrony, firewalld, and iputils.
8585
+
8686
.Example out-of-cluster Containerfile to apply the libreswan utility
87-
[source,yaml]
87+
[source,yaml,subs="attributes+"]
8888
----
89-
include::https://raw.githubusercontent.com/openshift/rhcos-image-layering-examples/master/libreswan/Containerfile[]
89+
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
90+
# hadolint ignore=DL3006
91+
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
92+
93+
# Install our config file
94+
COPY my-host-to-host.conf /etc/ipsec.d/
95+
96+
# {op-system-base} entitled host is needed here to access {op-system-base} packages
97+
# Install libreswan as extra {op-system-base} package
98+
RUN dnf install -y libreswan && \
99+
dnf clean all && \
100+
systemctl enable ipsec && \
101+
ostree container commit
90102
----
91103
+
92104
Because libreswan requires additional {op-system-base} packages, the image must be built on an entitled {op-system-base} host. For RHEL entitlements to work, you must copy the `etc-pki-entitlement` secret into the `openshift-machine-api` namespace.
@@ -114,9 +126,17 @@ RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.n
114126
----
115127
+
116128
.Example out-of-cluster Containerfile to apply a third-party package from EPEL
117-
[source,yaml]
129+
[source,yaml,subs="attributes+"]
118130
----
119-
include::https://raw.githubusercontent.com/openshift/rhcos-image-layering-examples/master/htop/Containerfile[]
131+
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
132+
# hadolint ignore=DL3006
133+
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
134+
135+
#Enable EPEL (more info at https://docs.fedoraproject.org/en-US/epel/ ) and install htop
136+
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
137+
dnf install -y htop && \
138+
dnf clean all && \
139+
ostree container commit
120140
----
121141
+
122142
This Containerfile installs the {op-system-base} fish program. Because fish requires additional {op-system-base} packages, the image must be built on an entitled {op-system-base} host. For {op-system-base} entitlements to work, you must copy the `etc-pki-entitlement` secret into the `openshift-machine-api` namespace.
@@ -134,9 +154,17 @@ RUN dnf install -y https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Pac
134154
----
135155
+
136156
.Example out-of-cluster Containerfile to apply a third-party package that has {op-system-base} dependencies
137-
[source,yaml]
157+
[source,yaml,subs="attributes+"]
138158
----
139-
include::https://raw.githubusercontent.com/openshift/rhcos-image-layering-examples/master/fish/Containerfile[]
159+
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
160+
# hadolint ignore=DL3006
161+
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
162+
163+
# {op-system-base} entitled host is needed here to access {op-system-base} packages
164+
# Install fish as third party package from EPEL
165+
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 && \
166+
dnf clean all && \
167+
ostree container commit
140168
----
141169

142170
After you create the machine config, the Machine Config Operator (MCO) performs the following steps:

0 commit comments

Comments
 (0)