File Dockerfile of Package elemental-base-os
#!BuildTag: uc-base-os-common:%OS_VERSION_ID_SP%-%RELEASE%
#!BuildTag: uc-base-os-common:%OS_VERSION_ID_SP%
#!BuildTag: uc-base-os-common:latest
ARG OS_IMAGE=bci/bci-base
ARG OS_VERSION=16.0
FROM ${OS_IMAGE}:${OS_VERSION} AS os
ARG OS_BRANDING=SLE
ARG BUILD_FLAVOR
RUN set -euo pipefail; mkdir -p /target
RUN set -euo pipefail; zypper --non-interactive --gpg-auto-import-keys --installroot /target install --no-recommends -- \
openSUSE-release openSUSE-release-appliance-custom \
patterns-base-base \
patterns-base-selinux \
patterns-microos-hardware \
aaa_base-extras \
acl \
audit \
btrfsmaintenance \
btrfsprogs \
chrony \
chrony-pool-suse \
combustion \
curl \
dosfstools \
dracut \
efibootmgr \
fipscheck \
gio-branding-${OS_BRANDING} \
git-core \
gptfdisk \
iproute2 \
iptables \
iputils \
less \
lsof \
NetworkManager \
NetworkManager-branding-${OS_BRANDING} \
openssh \
parted \
podman \
rsync \
shim \
snapper \
systemd \
systemd-default-settings-branding-SLE-Micro \
tar \
vim-small
# RUN if [ "${OS_BRANDING}" = "SLE" ]; then zypper -n install patterns-micro-hardware patterns-micro-fips systemd-default-settings-branding-SLE-Micro; fi
RUN zypper clean --all
# Remove existing /etc/machine-id file so that Ignition
# can be triggered at firstboot
RUN rm -f /target/etc/machine-id
# Add empty /etc/locale.conf and /etc/vconsole.conf so that
# we do not get an interactive firstboot process
RUN touch /target/etc/locale.conf
RUN touch /target/etc/vconsole.conf
FROM scratch
COPY --from=os /target /
# Make sure trusted certificates are properly generated
# NOTE: this should be done because "--installroot" option is used in zypper!
RUN set -euo pipefail; /sbin/update-ca-certificates
# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.sl.micro
LABEL org.opencontainers.image.title="openSUSE Dumbledore Common OS Container"
LABEL org.opencontainers.image.description="Container image for openSUSE Dumbledore Base - a containerized OS layer for Kubernetes."
LABEL org.opencontainers.image.version="%OS_VERSION_ID_SP%-%RELEASE%"
LABEL org.opencontainers.image.url="https://github.com/SUSE/elemental"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opencontainers.image.source="%SOURCEURL%"
LABEL org.opensuse.reference="registry.suse.com/uc-base-os-common:%OS_VERSION_ID_SP%-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
# endlabelprefix
# Install systemd presets
COPY 55-default-elemental3.preset /usr/lib/systemd/system-preset/55-default-elemental3.preset
RUN systemctl preset-all
# Install Live Setup dracut module for installer ISOs
RUN mkdir -p /usr/lib/dracut/modules.d/90elemental-live
COPY --chmod=700 module-setup.sh /usr/lib/dracut/modules.d/90elemental-live/module-setup.sh
COPY elemental-live-setup.service /usr/lib/dracut/modules.d/90elemental-live/elemental-live-setup.service
# Install a POC to upgrade rke2
COPY --chmod=0700 rke2-upgrade.sh /root/bin/rke2-upgrade
# Launch systemd as init
CMD ["/usr/lib/systemd/systemd"]