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 -- \
patterns-elemental3-hostos && zypper clean --all && \
# workaround for bsc#1254220
rm -rf /target/target
# 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.opensuse.org/%%IMG_PREFIX%%/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
# Set default runlevel to multi-user
RUN systemctl set-default multi-user
# 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"]