Skip to content

Commit

Permalink
Introduce RHEL family (#1953)
Browse files Browse the repository at this point in the history
* Introduce RHEL family

- merges the files for rockylinux and almalinux into a rhel dockerfile
- decided not to add fedora into this since, it requires to add the epel packages, which might make fedora too close to rhel for our community users. But wonder what you think, is it a good/bad idea to try to also merge that one?

Clean up fedora dockerfile

- remove packages which are already installed by default "coreutils" and "curl"
- make it similar to the other dockerfiles for easier maintenance

Signed-off-by: Mauro Morales <[email protected]>

* Add fedora to rhel family

Signed-off-by: Mauro Morales <[email protected]>

* Introduce inbetween stage for readability

Signed-off-by: Mauro Morales <[email protected]>

---------

Signed-off-by: Mauro Morales <[email protected]>
  • Loading branch information
mauromorales authored Oct 26, 2023
1 parent 1ad015a commit bd83ec9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 132 deletions.
12 changes: 6 additions & 6 deletions .github/flavors.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
"worker": "ubuntu-latest"
},
{
"family": "fedora",
"family": "rhel",
"flavor": "fedora",
"flavorRelease": "38",
"variant": "standard",
Expand All @@ -270,7 +270,7 @@
"worker": "self-hosted"
},
{
"family": "fedora",
"family": "rhel",
"flavor": "fedora",
"flavorRelease": "38",
"variant": "core",
Expand Down Expand Up @@ -320,7 +320,7 @@
"worker": "self-hosted"
},
{
"family": "rockylinux",
"family": "rhel",
"flavor": "rockylinux",
"flavorRelease": "9",
"variant": "standard",
Expand All @@ -330,7 +330,7 @@
"worker": "self-hosted"
},
{
"family": "rockylinux",
"family": "rhel",
"flavor": "rockylinux",
"flavorRelease": "9",
"variant": "core",
Expand All @@ -340,7 +340,7 @@
"worker": "self-hosted"
},
{
"family": "almalinux",
"family": "rhel",
"flavor": "almalinux",
"flavorRelease": "9",
"variant": "standard",
Expand All @@ -350,7 +350,7 @@
"worker": "self-hosted"
},
{
"family": "almalinux",
"family": "rhel",
"flavor": "almalinux",
"flavorRelease": "9",
"variant": "core",
Expand Down
7 changes: 4 additions & 3 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ ci:
ARG --required BASE_IMAGE
ARG --required MODEL
ARG --required VARIANT
ARG --required FAMILY

BUILD +base-image
IF [ "$SECURITY_SCANS" = "true" ]
Expand Down Expand Up @@ -435,9 +436,9 @@ base-image:

# Set /boot/vmlinuz pointing to our kernel so kairos-agent can use it
# https://github.com/kairos-io/kairos-agent/blob/0288fb111bc568a1bfca59cb09f39302220475b6/pkg/elemental/elemental.go#L548 q
IF [ "$FLAVOR" = "fedora" ] || [ "$FLAVOR" = "rockylinux" ] || [ "$FLAVOR" = "almalinux" ]
RUN rm -rf /boot/initramfs-*
END

# this is generally present on rhel based systems, but it doesn't hurt to remove in any case
RUN rm -rf /boot/initramfs-* || true

IF [ ! -e "/boot/vmlinuz" ]
IF [ -e "/boot/vmlinuz-lts" ]
Expand Down
59 changes: 0 additions & 59 deletions images/Dockerfile.almalinux

This file was deleted.

58 changes: 0 additions & 58 deletions images/Dockerfile.fedora

This file was deleted.

27 changes: 21 additions & 6 deletions images/Dockerfile.rockylinux → images/Dockerfile.rhel
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
ARG BASE_IMAGE=rockylinux:9
ARG BASE_IMAGE
ARG FLAVOR

FROM $BASE_IMAGE
FROM $BASE_IMAGE AS base

RUN echo "install_weak_deps=False" >> /etc/dnf/dnf.conf

# Install packages according to distro
# epel-packages https://docs.fedoraproject.org/en-US/epel/
FROM base AS epel
RUN dnf install -y epel-release && dnf clean all
RUN dnf install -y "https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm" && dnf clean all

FROM epel AS almalinux
FROM epel AS rockylinux

FROM base AS fedora
RUN dnf install -y "https://zfsonlinux.org/fedora/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm" && dnf clean all

# install common packages
FROM ${FLAVOR} AS common
RUN dnf update -y
RUN dnf makecache
RUN dnf install -y \
Expand All @@ -19,16 +33,17 @@ RUN dnf install -y \
dhcp-client \
e2fsprogs \
efibootmgr \
epel-release \
gawk \
gdisk \
grub2 \
grub2-efi-x64 \
grub2-efi-x64-modules \
grub2-pc \
haveged \
kernel \
kernel-modules \
kernel-modules-extra \
less \
livecd-tools \
lvm2 \
nano \
Expand All @@ -43,12 +58,12 @@ RUN dnf install -y \
systemd \
systemd-networkd \
systemd-resolved \
systemd-timesyncd \
tar \
which \
https://zfsonlinux.org/epel/zfs-release-2-2.el9.noarch.rpm \
&& dnf clean all
zfs && dnf clean all

# Final setup
FROM common
RUN mkdir -p /run/lock
RUN touch /usr/libexec/.keep
RUN systemctl enable [email protected]
Expand Down

0 comments on commit bd83ec9

Please sign in to comment.