Skip to content

Commit c7658bd

Browse files
committed
OSDOCS-12604: inline containerfiles
1 parent 434e002 commit c7658bd

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 rpm-ostree override replace https://example.com/myrepo/haproxy-1.0.16-5.el8.
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.
@@ -113,9 +125,17 @@ RUN rpm-ostree install https://dl.fedoraproject.org/pub/epel/epel-release-latest
113125
----
114126
+
115127
.Example out-of-cluster Containerfile to apply a third-party package from EPEL
116-
[source,yaml]
128+
[source,yaml,subs="attributes+"]
117129
----
118-
include::https://raw.githubusercontent.com/openshift/rhcos-image-layering-examples/master/htop/Containerfile[]
130+
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
131+
# hadolint ignore=DL3006
132+
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
133+
134+
#Enable EPEL (more info at https://docs.fedoraproject.org/en-US/epel/ ) and install htop
135+
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
136+
dnf install -y htop && \
137+
dnf clean all && \
138+
ostree container commit
119139
----
120140
+
121141
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.
@@ -132,9 +152,17 @@ RUN rpm-ostree install https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64
132152
----
133153
+
134154
.Example out-of-cluster Containerfile to apply a third-party package that has {op-system-base} dependencies
135-
[source,yaml]
155+
[source,yaml,subs="attributes+"]
136156
----
137-
include::https://raw.githubusercontent.com/openshift/rhcos-image-layering-examples/master/fish/Containerfile[]
157+
# Get {op-system} base image of target cluster `oc adm release info --image-for rhel-coreos`
158+
# hadolint ignore=DL3006
159+
FROM quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256...
160+
161+
# {op-system-base} entitled host is needed here to access {op-system-base} packages
162+
# Install fish as third party package from EPEL
163+
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 && \
164+
dnf clean all && \
165+
ostree container commit
138166
----
139167

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

0 commit comments

Comments
 (0)