72 lines
3.0 KiB
Docker
72 lines
3.0 KiB
Docker
ARG OS_VERSION=8.10
|
|
|
|
FROM docker.io/almalinux:${OS_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=no"' >> /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; \
|
|
echo "appuser:x:10000:" >> /mnt/rootfs/etc/group ; \
|
|
echo "appuser:x:10000:10000:appuser:/app:/bin/sh" >> /mnt/rootfs/etc/passwd ; \
|
|
echo "appuser:!!:20070::::::" >> /mnt/rootfs/etc/shadow ;
|
|
|
|
FROM scratch
|
|
|
|
ARG OS_VERSION=8.10
|
|
|
|
ENV LANG=C.utf8
|
|
|
|
LABEL maintainer="Muhamad Aditya Prima <aprimediet@gmail.com>"
|
|
LABEL name="almalinux"
|
|
LABEL version="${OS_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 /
|
|
|
|
RUN mkdir -p /app; \
|
|
chmod 700 /app; \
|
|
chown -R 10000:10000 /app;
|
|
|
|
USER appuser
|
|
WORKDIR /app
|
|
|
|
CMD ["/bin/sh"] |