Skip to content

Commit

Permalink
README for rhel-9 container example
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathon Anderson <[email protected]>
  • Loading branch information
anderbubble committed Nov 7, 2024
1 parent 5596f8f commit 0f39074
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
43 changes: 17 additions & 26 deletions examples/rhel-9/Containerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
FROM registry.access.redhat.com/ubi9/ubi:9.3

# copy the build system's subscription
# https://access.redhat.com/solutions/5870841
##COPY subscription/redhat.repo /etc/yum.repos.d/redhat.repo
##COPY subscription/rhsm/* /etc/rhsm
##COPY subscription/entitlement/* /etc/pki/entitlement
##RUN rm -f /etc/rhsm-host && rm -f /etc/pki/entitlement-host


#Versionlock the kernel:
RUN dnf install -y \
kernel-0:5.14.0-362.24.1.el9_3 \
kernel-core-0:5.14.0-362.24.1.el9_3 \
kernel-headers-0:5.14.0-362.24.1.el9_3 \
kernel-modules-core-0:5.14.0-362.24.1.el9_3

RUN dnf install -y \
python3-dnf-plugin-versionlock
RUN dnf versionlock -y \
kernel-0:5.14.0-362.24.1.el9_3.* \
kernel-core-0:5.14.0-362.24.1.el9_3.* \
kernel-headers-0:5.14.0-362.24.1.el9_3.* \
kernel-modules-core-0:5.14.0-362.24.1.el9_3.*


# this imitates a server groupinstall
RUN dnf install -y --allowerasing \
kernel-0:5.14.0-362.24.1.el9_3 \
kernel-core-0:5.14.0-362.24.1.el9_3 \
kernel-headers-0:5.14.0-362.24.1.el9_3 \
kernel-modules-core-0:5.14.0-362.24.1.el9_3 \
python3-dnf-plugin-versionlock \
coreutils \
cpio \
dhclient \
Expand All @@ -52,11 +33,21 @@ RUN dnf install -y --allowerasing \
which \
words \
rdma-core \
&& dnf clean all
&& dnf clean all \
&& dnf versionlock -y \
kernel-0:5.14.0-362.24.1.el9_3.* \
kernel-core-0:5.14.0-362.24.1.el9_3.* \
kernel-headers-0:5.14.0-362.24.1.el9_3.* \
kernel-modules-core-0:5.14.0-362.24.1.el9_3.*

# Unmask what RHEL masked in the ubi
# Needed to get an actual login tty
RUN rm -f /etc/systemd/system/systemd-logind.service && rm -f /etc/systemd/system/getty.target && rm -f /etc/systemd/system/console-getty.service && rm -f /etc/systemd/system/sys-fs-fuse-connections.mount && rm -f /etc/systemd/system/systemd-remount-fs.service && rm -f /etc/systemd/system/dev-hugepages.mount
RUN rm -f /etc/systemd/system/systemd-logind.service \
&& rm -f /etc/systemd/system/getty.target \
&& rm -f /etc/systemd/system/console-getty.service \
&& rm -f /etc/systemd/system/sys-fs-fuse-connections.mount \
&& rm -f /etc/systemd/system/systemd-remount-fs.service \
&& rm -f /etc/systemd/system/dev-hugepages.mount

# For SELinux enabled nodes:

Expand Down
18 changes: 18 additions & 0 deletions examples/rhel-9/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Red Hat Enterprise Linux 9

Warewulf can be used to boot a RHEL node,
but building such an image typically requires access to a Red Hat subscription.
This subscription can be accessed from the host environment
by mounting subscription files.


```
podman build \
--volume=/etc/pki/entitlement:/run/secrets/entitlement:ro \
--volume=/etc/rhsm:/run/secrets/rhsm:ro \
--volume=/etc/yum.repos.d/redhat.repo:/run/secrets/redhat.repo:ro \
. --tag rhel:9
```

For more information,
see https://access.redhat.com/solutions/5870841.

0 comments on commit 0f39074

Please sign in to comment.