File Dockerfile of Package baseos

#!BuildTag: baseos:latest
#

FROM suse/sl-micro/6.1/baremetal-os-container:latest

# Remove redundant packages
RUN zypper remove -y \
    elemental-register \
    elemental-support \
    elemental-system-agent \
    elemental-updater \
    podman

RUN zypper remove -yu ModemManager

# The SL Micro base container image includes systemd-default-settings-branding-openSUSE,
# but should be systemd-default-settings-branding-SLE-Micro (bsc#1253661)
RUN zypper in -y --force-resolution systemd-default-settings-branding-SLE-Micro

# Upgrade to the latest kernel available in the project repo.  This avoids
# potential drift when subsequently building the baseos-headers image, which
# will always pull in the latest kernel-source, whereas the underlying
# baremetal-os-container image may not be updated to that kernel yet.  We need
# to temporarily remove the default "multiversion = provides:multiversion(kernel)"
# line from /etc/zypp/zypp.conf when doing this, or we'll end up with multiple
# kernels installed, where we actually want there to be only one.
RUN cp -a /etc/zypp/zypp.conf /etc/zypp/zypp.conf.bak && \
    sed -i '/^multiversion =.*$/d' /etc/zypp/zypp.conf && \
    zypper in -y --force kernel-default && \
    mv /etc/zypp/zypp.conf.bak /etc/zypp/zypp.conf

# Harvester packages
RUN zypper in -y \
    ca-certificates \
    ca-certificates-mozilla \
    iotop \
    ipmitool \
    kdump \
    kernel-firmware-amdgpu \
    kernel-firmware-nvidia \
    kernel-firmware-radeon \
    nfs-utils \
    nginx \
    numactl \
    supportutils \
    tcpdump \
    traceroute \
    xorriso \
    fio \
    audit \
    smartmontools \
    hwinfo \
    usbutils \
    sysvinit-tools \
    k9s \
    yip \
    tmux \
    sensors \
    yq \
    nvme-cli \
    kubevirt-virtctl \
    bind-utils \
    qemu-guest-agent \
    sysfsutils \
    helm \
    fcoe-utils
    
# Only install in x86_64 builds
#!ArchExclusiveLine: x86_64
RUN ARCH=$(uname -m); \
    if [ "${ARCH}" = "x86_64" ]; then \
    zypper in -y ucode-amd ucode-intel; \
    fi

# elemental-toolkit >= v1.2.0 doesn't support BIOS boot, so downgrade to elemental v1.1.7
RUN zypper in -y --oldpackage 'elemental-toolkit<1.2'

# Show installed package version
RUN zypper se -s -i

# Disable sftp-subsystem by default (harvester has an install-time option for
# enabling this)
RUN sed -i 's/^\([^#]*Subsystem.*sftp\)/#\1/' /usr/etc/ssh/sshd_config

# Remove elemental v2 stuff that's installed in the SL Micro 6.1 base container
# by default as a result of that base container's call to `elemental init`
RUN rm -rf /usr/lib/dracut/modules.d/*elemental* /etc/dracut.conf.d/*elemental* /boot/elemental.initrd* /boot/initrd
RUN find /etc/systemd/system -name '*elemental*' | xargs rm

# Get elemental v1.1.7 set up correctly
RUN elemental init --force

# Create initrd symlink (`elemental init` in elemental v1.1.7 doesn't do this automatically)
RUN ln -s /boot/initrd-* /boot/initrd

# Save some space
RUN zypper clean --all && \
    rm -rf /var/log/update* && \
    >/var/log/lastlog && \
    rm -rf /boot/vmlinux*

RUN echo "builtAt=\"$(date "+%Y%m%d%H%M%S")\"" > /etc/harvester-os
openSUSE Build Service is sponsored by