ARG ALMALINUX_VERSION=8.10 FROM docker.io/almalinux:${ALMALINUX_VERSION} AS builder RUN mkdir -p /mnt/rootfs; \ dnf -y install \ coreutils-single \ glibc-minimal-langpack \ microdnf \ libusbx \ langpacks-en \ rootfiles \ --installroot /mnt/rootfs --releasever 8 --setopt install_weak_deps=false --nodocs; \ dnf --installroot /mnt/rootfs clean all; # Additional hacks for kickstart file and backward compatable support RUN rm -rf /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* /mnt/rootfs/var/cache/dnf /mnt/rootfs/var/lib/dnf/repos; \ rm -rf /mnt/rootfs/var/lib/dnf/history* /mnt/rootfs/var/log/hawkey.log /mnt/rootfs/boot /mnt/rootfs/dev/null /mnt/rootfs/run/*; \ mkdir -p /mnt/rootfs/run/lock; \ # generate build time file for compatibility with CentOS /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; \ touch /mnt/rootfs/etc/.pwd.lock; \ chmod 600 /mnt/rootfs/etc/.pwd.lock; \ 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; \ rm -rf /mnt/rootfs/usr/share/locale/en_CA/ /mnt/rootfs/usr/share/locale/en_GB/ /mnt/rootfs/usr/share/locale/en@* /mnt/rootfs/usr/share/locale/en /mnt/rootfs/usr/share/locale/en*@* /mnt/rootfs/usr/share/i18n/charmaps /mnt/rootfs/usr/share/i18n/locales ;\ rm -f /mnt/rootfs/etc/machine-id; \ touch /mnt/rootfs/etc/machine-id; \ touch /mnt/rootfs/etc/resolv.conf; \ touch /mnt/rootfs/etc/hostname; \ cd /mnt/rootfs/etc ; \ ln -s ../usr/share/zoneinfo/Asia/Jakarta localtime FROM scratch ARG ALMALINUX_VERSION=8.10 LABEL maintainer="Muhamad Aditya Prima " LABEL name="almalinux" LABEL version="${ALMALINUX_VERSION}" LABEL distribution-scope="public" #labels for container catalog LABEL summary="Almalinux 8 container image" LABEL description="Provide latest release of Almalinux 8 container image" LABEL io.k8s.description="Almalinux 8" LABEL io.k8s.display-name="Almalinux 8" COPY --from=builder /mnt/rootfs / ENV LANG=C.utf8 CMD ["/bin/sh"]