2021-10-15 03:28:10 +00:00
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
# Multi stage docker build for live cd tools in docker/container environment
|
|
|
|
# AlmaLinux Init + Live CD Tools + PyKickStart
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
FROM almalinux:8 as builder
|
|
|
|
|
|
|
|
RUN dnf install -y epel-release && \
|
|
|
|
# dnf upgrade -y && \
|
|
|
|
mkdir -p /mnt/system-root /mnt/system-root/build; \
|
2022-09-15 11:41:07 +00:00
|
|
|
dnf --enablerepo=powertools --enablerepo="epel" \
|
2021-10-15 03:28:10 +00:00
|
|
|
install --installroot /mnt/system-root --releasever 8 --setopt=install_weak_deps=False --setopt=tsflags=nodocs -y \
|
|
|
|
bash \
|
|
|
|
dnf \
|
2022-09-15 11:41:07 +00:00
|
|
|
glibc-all-langpacks \
|
|
|
|
glibc-langpack-en \
|
2021-10-15 03:28:10 +00:00
|
|
|
anaconda-tui \
|
|
|
|
appliance-tools \
|
|
|
|
lorax \
|
|
|
|
subscription-manager \
|
|
|
|
jq \
|
|
|
|
tar \
|
|
|
|
policycoreutils \
|
|
|
|
pykickstart \
|
|
|
|
# Optional include to avoid runtime warning -- starts
|
|
|
|
libblockdev-mdraid \
|
|
|
|
libblockdev-crypto \
|
|
|
|
libblockdev-lvm \
|
|
|
|
libblockdev-dm \
|
|
|
|
libblockdev-swap \
|
|
|
|
libblockdev-loop \
|
|
|
|
libblockdev-nvdimm \
|
|
|
|
libblockdev-mpath \
|
|
|
|
# Optional include to avoid runtime warning -- ends
|
|
|
|
rootfiles \
|
|
|
|
util-linux-ng \
|
|
|
|
systemd \
|
|
|
|
livecd-tools \
|
|
|
|
pykickstart \
|
2022-09-15 11:41:07 +00:00
|
|
|
# grub2-efi-*64 \
|
|
|
|
# grub2-efi-*64-cdboot \
|
|
|
|
# shim-*64 \
|
|
|
|
tini ; \
|
|
|
|
# Temp fix for dnf until fix is ported to EL8
|
|
|
|
# imgcreate.errors.MountError: Unable to unmount filesystem at /var/tmp/imgcreate-XXXXXX/install_root/var/cache/dnf.
|
|
|
|
cwd=$PWD \
|
|
|
|
cd /mnt/system-root/usr/lib/python3.6/site-packages/dnf/ ;\
|
|
|
|
mv base.py base.py_saved ;\
|
|
|
|
curl -LO https://raw.githubusercontent.com/AlmaLinux/sig-livemedia/build-fix/work/scripts/base.py ; \
|
|
|
|
cd $cwd ; \
|
|
|
|
# cp /etc/yum.repos.d/e* /mnt/system-root/etc/yum.repos.d/ ; \
|
2021-10-15 03:28:10 +00:00
|
|
|
/bin/date +%Y%m%d_%H%M > /mnt/system-root/etc/BUILDTIME ;\
|
|
|
|
# set DNF infra variable to container for compatibility with CentOS
|
2022-09-15 11:41:07 +00:00
|
|
|
# echo 'container' > /mnt/system-root/etc/dnf/vars/infra; \
|
2021-10-15 03:28:10 +00:00
|
|
|
# install only en_US.UTF-8 locale files, see
|
|
|
|
# https://fedoraproject.org/wiki/Changes/Glibc_locale_subpackaging for details
|
2022-09-15 11:41:07 +00:00
|
|
|
# echo '%_install_langs en_US.UTF-8' > /mnt/system-root/etc/rpm/macros.image-language-conf; \
|
|
|
|
echo 'LANG="en_US.UTF-8"' > /mnt/system-root/etc/locale.conf; \
|
2021-10-15 03:28:10 +00:00
|
|
|
touch /mnt/system-root/etc/machine-id; \
|
|
|
|
rm -rf /var/cache/yum;
|
|
|
|
#
|
|
|
|
COPY scripts/ /mnt/system-root/usr/bin
|
|
|
|
#
|
|
|
|
# Create Final image from scratch for ks2rootfs
|
|
|
|
FROM scratch
|
|
|
|
|
|
|
|
COPY --from=builder /mnt/system-root/ /
|
|
|
|
|
|
|
|
RUN systemctl mask \
|
|
|
|
dev-hugepages.mount \
|
|
|
|
systemd-logind.service \
|
|
|
|
getty.target \
|
|
|
|
console-getty.service \
|
|
|
|
systemd-machine-id-commit.service
|
|
|
|
|
|
|
|
WORKDIR /build
|
2022-09-15 11:41:07 +00:00
|
|
|
ENTRYPOINT [ "tini", "--" ]
|
2021-10-15 03:28:10 +00:00
|
|
|
|
2022-09-15 11:41:07 +00:00
|
|
|
CMD ["/bin/bash"]
|
2021-10-15 03:28:10 +00:00
|
|
|
|
|
|
|
#ENTRYPOINT ["/bin/bash"]
|