ARG ALMALINUX_VERSION=8.10 FROM docker.io/almalinux:${ALMALINUX_VERSION} AS builder RUN mkdir -p /mnt/rootfs; \ dnf install --installroot /mnt/rootfs \ coreutils-single \ glibc-minimal-langpack \ --releasever 8 --setopt install_weak_deps=false --nodocs -y; \ dnf --installroot /mnt/rootfs clean all; # Additional hacks for kickstart file and backward compatable support RUN rm -rf /mnt/rootfs/var/cache/dnf /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/lib/dnf /mnt/rootfs/var/log/yum.* /mnt/rootfs/var/lib/rpm/* ; \ /bin/date +%Y%m%d_%H%M > /mnt/rootfs/etc/BUILDTIME ; \ echo '%_install_langs C.utf8' > /mnt/rootfs/etc/rpm/macros.image-language-conf; \ echo 'LANG="C.utf8"' > /mnt/rootfs/etc/locale.conf; \ echo 'container' > /mnt/rootfs/etc/dnf/vars/infra; \ rm -f /mnt/rootfs/etc/machine-id; \ touch /mnt/rootfs/etc/machine-id; \ touch /mnt/rootfs/etc/.pwd.lock; \ touch /mnt/rootfs/etc/resolv.conf; \ touch /mnt/rootfs/etc/hostname; \ chmod 600 /mnt/rootfs/etc/.pwd.lock; \ rm -rf /mnt/rootfs/usr/share/locale/en* /mnt/rootfs/boot /mnt/rootfs/dev/null /mnt/rootfs/var/log/hawkey.log \ /mnt/rootfs/usr/share/zoneinfo /mnt/rootfs/usr/share/licenses/* \ /mnt/rootfs/etc/yum.repos.d ; \ echo '0.000000 1728971976 0.000000' > /mnt/rootfs/etc/adjtime; \ echo '1728971976' >> /mnt/rootfs/etc/adjtime; \ echo 'LOCAL' >> /mnt/rootfs/etc/adjtime; \ # echo '# This file has been generated by the Anaconda Installer.' > /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ # echo '# Allow root to log in using ssh. Remove this file to opt-out.' >> /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ # echo 'PERMITROOTLOGIN="-oPermitRootLogin=yes"' >> /mnt/rootfs/etc/sysconfig/sshd-permitrootlogin ;\ echo 'KEYMAP="us"' > /mnt/rootfs/etc/vconsole.conf; \ echo 'FONT="eurlatgr"' >> /mnt/rootfs/etc/vconsole.conf; \ cp ../usr/share/zoneinfo/Asia/Jakarta /mnt/rootfs/etc/localtime ; FROM scratch ARG ALMALINUX_VERSION=8.10 LABEL maintainer="Muhamad Aditya Prima " LABEL name="almalinux-micro" LABEL version="${ALMALINUX_VERSION}" LABEL distribution-scope="public" #labels for container catalog LABEL summary="Almalinux 9 micro container image" LABEL description="Provide latest release of micro Almalinux 9 container base image" LABEL io.k8s.description="Very small almalinux 9 based image which doesn't install package manager" LABEL io.k8s.display-name="Almalinux 9 Micro" COPY --from=builder /mnt/rootfs/ / CMD ["/bin/sh"]