diff --git a/.github/flavors.json b/.github/flavors.json index 91bab4ca7..ba2059622 100644 --- a/.github/flavors.json +++ b/.github/flavors.json @@ -260,7 +260,7 @@ "worker": "ubuntu-latest" }, { - "family": "fedora", + "family": "rhel", "flavor": "fedora", "flavorRelease": "38", "variant": "standard", @@ -270,7 +270,7 @@ "worker": "self-hosted" }, { - "family": "fedora", + "family": "rhel", "flavor": "fedora", "flavorRelease": "38", "variant": "core", @@ -320,7 +320,7 @@ "worker": "self-hosted" }, { - "family": "rockylinux", + "family": "rhel", "flavor": "rockylinux", "flavorRelease": "9", "variant": "standard", @@ -330,7 +330,7 @@ "worker": "self-hosted" }, { - "family": "rockylinux", + "family": "rhel", "flavor": "rockylinux", "flavorRelease": "9", "variant": "core", @@ -340,7 +340,7 @@ "worker": "self-hosted" }, { - "family": "almalinux", + "family": "rhel", "flavor": "almalinux", "flavorRelease": "9", "variant": "standard", @@ -350,7 +350,7 @@ "worker": "self-hosted" }, { - "family": "almalinux", + "family": "rhel", "flavor": "almalinux", "flavorRelease": "9", "variant": "core", diff --git a/Earthfile b/Earthfile index e5e179159..7c2420397 100644 --- a/Earthfile +++ b/Earthfile @@ -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" ] @@ -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" ] diff --git a/images/Dockerfile.almalinux b/images/Dockerfile.almalinux deleted file mode 100644 index 42fdc9bc1..000000000 --- a/images/Dockerfile.almalinux +++ /dev/null @@ -1,59 +0,0 @@ -ARG BASE_IMAGE=almalinux:latest - -FROM $BASE_IMAGE - -RUN echo "install_weak_deps=False" >> /etc/dnf/dnf.conf - -RUN dnf install -y epel-release && dnf clean all -RUN dnf update -y -RUN dnf makecache -RUN dnf install -y \ - audit \ - cloud-utils-growpart \ - device-mapper \ - dosfstools \ - dracut \ - dracut-live \ - dracut-network \ - dracut-squash \ - dhcp-client \ - e2fsprogs \ - efibootmgr \ - epel-release \ - gawk \ - gdisk \ - grub2 \ - grub2-efi-x64 \ - grub2-efi-x64-modules \ - grub2-pc \ - kernel \ - kernel-modules \ - kernel-modules-extra \ - livecd-tools \ - lvm2 \ - nano \ - openssh-server \ - parted \ - polkit \ - qemu-guest-agent \ - rsync \ - shim-x64 \ - squashfs-tools \ - sudo \ - systemd \ - systemd-networkd \ - systemd-resolved \ - systemd-timesyncd \ - tar \ - which \ - https://zfsonlinux.org/epel/zfs-release-2-2.el9.noarch.rpm && dnf clean all - -RUN mkdir -p /run/lock -RUN touch /usr/libexec/.keep -RUN systemctl enable getty@tty1.service -RUN systemctl enable getty@tty2.service -RUN systemctl enable getty@tty3.service -RUN systemctl enable systemd-networkd -RUN systemctl enable systemd-resolved -RUN systemctl disable dnf-makecache.service -RUN systemctl enable sshd diff --git a/images/Dockerfile.fedora b/images/Dockerfile.fedora deleted file mode 100644 index b22eb99c0..000000000 --- a/images/Dockerfile.fedora +++ /dev/null @@ -1,58 +0,0 @@ -# latest is the last stable release, does not include rawhide -ARG BASE_IMAGE=fedora:latest - -FROM $BASE_IMAGE - -RUN echo "install_weak_deps=False" >> /etc/dnf/dnf.conf -RUN dnf install -y "https://zfsonlinux.org/fedora/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm" && dnf clean all -RUN dnf install -y \ - audit \ - coreutils \ - cloud-utils-growpart \ - curl \ - device-mapper \ - dosfstools \ - dracut \ - dracut-live \ - dracut-network \ - dracut-squash \ - dhcp-client \ - e2fsprogs \ - efibootmgr \ - gawk \ - gdisk \ - grub2 \ - grub2-efi-x64 \ - grub2-efi-x64-modules \ - grub2-pc \ - haveged \ - kernel \ - kernel-modules \ - kernel-modules-extra \ - less \ - livecd-tools \ - lvm2 \ - nano \ - openssh-server \ - parted \ - polkit \ - qemu-guest-agent \ - rsync \ - shim-x64 \ - squashfs-tools \ - sudo \ - systemd \ - systemd-networkd \ - systemd-resolved \ - tar \ - which \ - zfs && dnf clean all - -RUN mkdir -p /run/lock && \ - touch /usr/libexec/.keep && \ - systemctl enable getty@tty1.service && \ - systemctl enable getty@tty2.service && \ - systemctl enable getty@tty3.service && \ - systemctl enable systemd-networkd && \ - systemctl enable systemd-resolved && \ - systemctl enable sshd diff --git a/images/Dockerfile.rockylinux b/images/Dockerfile.rhel similarity index 64% rename from images/Dockerfile.rockylinux rename to images/Dockerfile.rhel index a9715d5e2..6327cbf06 100644 --- a/images/Dockerfile.rockylinux +++ b/images/Dockerfile.rhel @@ -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 \ @@ -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 \ @@ -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 getty@tty1.service