fedora-kickstarts/fedora-docker-base.ks

82 lines
2.4 KiB
Plaintext
Raw Normal View History

# This is a minimal Fedora install designed to serve as a Docker base image.
2014-07-29 12:30:03 +00:00
#
# To keep this image minimal it only installs English language. You need to change
# yum configuration in order to enable other languages.
#
### Hacking on this image ###
# This kickstart is processed using Anaconda-in-ImageFactory (via Koji typically),
# but you can run imagefactory locally too.
#
# To do so, testing local changes, first you'll need a TDL file. I store one here:
# https://git.fedorahosted.org/cgit/fedora-atomic.git/tree/fedora-atomic-rawhide.tdl
#
# Then, once you have imagefactory and imagefactory-plugins installed, run:
#
# imagefactory --debug target_image --template /path/to/fedora-atomic-rawhide.tdl --parameter offline_icicle true --file-parameter install_script $(pwd)/fedora-docker-base.ks docker
#
2014-07-29 12:30:03 +00:00
cmdline
bootloader --disabled
timezone --isUtc --nontp Etc/UTC
rootpw --lock --iscrypted locked
2014-07-29 12:30:03 +00:00
keyboard us
zerombr
clearpart --all
part / --fstype ext4 --grow
network --bootproto=dhcp --device=link --activate --onboot=on
2014-07-29 12:30:03 +00:00
reboot
%packages --excludedocs --instLangs=en --nocore
bash
tar # https://bugzilla.redhat.com/show_bug.cgi?id=1409920
fedora-release
rootfiles
2014-07-29 12:30:03 +00:00
vim-minimal
2015-03-07 17:12:24 +00:00
dnf
dnf-yum # https://fedorahosted.org/fesco/ticket/1312#comment:29
sssd-client
#fakesystemd #TODO: waiting for review https://bugzilla.redhat.com/show_bug.cgi?id=1118740
2014-07-29 12:30:03 +00:00
-kernel
%end
%post --log=/root/anaconda-post.log
set -e
2014-07-29 12:30:03 +00:00
# Set the language rpm nodocs transaction flag persistently in the
# image yum.conf and rpm macros
2014-07-29 12:30:03 +00:00
LANG="en_US"
echo "%_install_langs $LANG" > /etc/rpm/macros.image-language-conf
2014-07-29 12:30:03 +00:00
echo "Import RPM GPG key"
releasever=$(rpm -q --qf '%{version}\n' fedora-release)
basearch=$(uname -i)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
echo "# fstab intentionally empty for containers" > /etc/fstab
2014-07-29 12:30:03 +00:00
rm -f /usr/lib/locale/locale-archive
#Setup locale properly
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
2014-07-29 12:30:03 +00:00
rm -rf /var/cache/yum/*
rm -f /tmp/ks-script*
#Mask mount units and getty service so that we don't get login prompt
systemctl mask systemd-remount-fs.service dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service getty.target console-getty.service
# Fix /run/lock breakage since it's not tmpfs in docker
umount /run
systemd-tmpfiles --create --boot
# Remove machine-id on pre generated images
rm -f /etc/machine-id
touch /etc/machine-id
2014-07-29 12:30:03 +00:00
%end