kickstarts/Rocky-8-Container-Minimal.ks

106 lines
2 KiB
Text
Raw Normal View History

2021-05-04 13:45:15 +00:00
# This is a minimal Rocky kickstart designed for docker.
# It will not produce a bootable system
2021-10-27 19:30:06 +00:00
# To use this kickstart, run make
2021-05-04 13:45:15 +00:00
# Basic setup information
2022-11-12 21:31:34 +00:00
url --url https://download.rockylinux.org/stg/rocky/8/BaseOS/$basearch/os/
2022-07-04 22:04:27 +00:00
text
bootloader --disable
2021-05-04 13:45:15 +00:00
firewall --disabled
network --bootproto=dhcp --device=link --activate --onboot=on
rootpw --lock --iscrypted locked
2021-10-26 23:55:24 +00:00
selinux --disabled
2021-05-04 13:45:15 +00:00
shutdown
keyboard us
lang en_US.UTF-8
timezone --isUtc --nontp UTC
2021-05-04 13:45:15 +00:00
# Disk setup
zerombr
clearpart --all --initlabel
autopart --noboot --nohome --noswap --nolvm --fstype=ext4
%pre
dbus-broker-launch --scope=none
%end
2022-12-17 17:54:43 +00:00
%addon com_redhat_kdump --disable
%end
2021-05-04 13:45:15 +00:00
# Package setup
2021-10-26 23:55:24 +00:00
%packages --ignoremissing --excludedocs --instLangs=en --nocore --excludeWeakdeps
2021-05-04 13:45:15 +00:00
bash
coreutils-single
glibc-minimal-langpack
2022-07-07 13:51:39 +00:00
microdnf
rocky-release
-brotli
2021-05-04 13:45:15 +00:00
-dosfstools
-e2fsprogs
-firewalld
2021-05-04 13:45:15 +00:00
-fuse-libs
-gettext*
2021-05-04 13:45:15 +00:00
-gnupg2-smime
-grub\*
2022-07-07 13:51:39 +00:00
-hostname
-iptables
2022-07-07 13:51:39 +00:00
-iputils
-kernel
2022-07-07 13:51:39 +00:00
-kexec-tools
-less
2021-05-04 13:45:15 +00:00
-libss
-os-prober*
2021-05-04 13:45:15 +00:00
-pinentry
-qemu-guest-agent
2022-07-07 13:51:39 +00:00
-rootfiles
2021-05-04 13:45:15 +00:00
-shared-mime-info
2022-07-07 13:51:39 +00:00
-tar
2021-05-04 13:45:15 +00:00
-trousers
2022-07-07 13:51:39 +00:00
-vim-minimal
2021-05-04 13:45:15 +00:00
-xfsprogs
-xkeyboard-config
2022-07-07 13:51:39 +00:00
-yum
2021-05-04 13:45:15 +00:00
%end
%post --erroronfail --log=/root/anaconda-post.log
# container customizations inside the chroot
2022-07-07 13:51:39 +00:00
rpm --rebuilddb
2021-05-04 13:45:15 +00:00
2022-07-07 13:51:39 +00:00
/bin/date +%Y-%m-%d_%H:%M:%S > /etc/BUILDTIME
2021-05-04 13:45:15 +00:00
2022-07-07 13:51:39 +00:00
echo 'container' > /etc/dnf/vars/infra
LANG="en_US"
echo '%_install_langs en_US.UTF-8' > /etc/rpm/macros.image-language-conf
2021-10-27 19:30:06 +00:00
echo 'LANG="C.UTF-8"' > /etc/locale.conf
2021-05-04 13:45:15 +00:00
2022-07-07 13:51:39 +00:00
rm -f /var/lib/dnf/history.*
rm -fr "/var/log/*" "/tmp/*" "/tmp/.*"
for dir in $(ls -d "/usr/share/{locale,i18n}/*" | grep -v 'en_US\|all_languages\|locale\.alias'); do rm -fr $dir; done
2021-05-04 13:45:15 +00:00
# systemd fixes
umount /run
systemd-tmpfiles --create --boot
# mask mounts and login bits
systemctl mask \
console-getty.service \
dev-hugepages.mount \
getty.target \
sys-fs-fuse-connections.mount \
systemd-logind.service \
systemd-remount-fs.service
2021-10-27 19:30:06 +00:00
# Cleanup the image
2021-05-04 13:45:15 +00:00
rm -f /etc/udev/hwdb.bin
2021-10-27 19:30:06 +00:00
rm -rf /usr/lib/udev/hwdb.d/ \
/boot /var/lib/dnf/history.* \
2022-07-07 13:51:39 +00:00
"/tmp/*" "/tmp/.*" || true
2021-05-04 13:45:15 +00:00
%end