2016-07-22 15:26:49 -05:00
|
|
|
# This is a minimal Fedora install designed to serve as a Docker base image.
|
2014-07-29 14:30:03 +02:00
|
|
|
#
|
|
|
|
# To keep this image minimal it only installs English language. You need to change
|
2017-01-23 10:54:01 -05:00
|
|
|
# dnf configuration in order to enable other languages.
|
2015-03-19 17:41:48 -04:00
|
|
|
#
|
|
|
|
### 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
|
2016-07-22 15:26:49 -05:00
|
|
|
#
|
2015-03-19 17:41:48 -04:00
|
|
|
# Then, once you have imagefactory and imagefactory-plugins installed, run:
|
2016-07-22 15:26:49 -05:00
|
|
|
#
|
2015-03-19 17:41:48 -04:00
|
|
|
# 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 14:30:03 +02:00
|
|
|
|
2017-01-19 15:46:44 -05:00
|
|
|
text # don't use cmdline -- https://github.com/rhinstaller/anaconda/issues/931
|
2015-05-15 17:35:52 -04:00
|
|
|
bootloader --disabled
|
2015-01-28 14:08:40 +05:30
|
|
|
timezone --isUtc --nontp Etc/UTC
|
2014-12-16 16:26:01 -05:00
|
|
|
rootpw --lock --iscrypted locked
|
2014-07-29 14:30:03 +02:00
|
|
|
keyboard us
|
2017-03-23 17:02:45 +00:00
|
|
|
network --bootproto=dhcp --device=link --activate --onboot=on
|
|
|
|
reboot
|
|
|
|
|
2017-03-23 17:08:24 +00:00
|
|
|
# boot partitions are irrelevant as none of that content is taken into the final docker image
|
|
|
|
# We will be able to move to autopart when new pykickstart lands which adds option for noswap/noboot (fixed upstream)
|
2014-07-29 14:30:03 +02:00
|
|
|
zerombr
|
|
|
|
clearpart --all
|
2017-03-23 17:02:45 +00:00
|
|
|
part /boot/efi --fstype="vfat" --size=100
|
2016-04-12 15:43:09 +01:00
|
|
|
part / --fstype ext4 --grow
|
2014-07-29 14:30:03 +02:00
|
|
|
|
|
|
|
%packages --excludedocs --instLangs=en --nocore
|
|
|
|
bash
|
2017-01-04 15:34:16 -06:00
|
|
|
tar # https://bugzilla.redhat.com/show_bug.cgi?id=1409920
|
2015-03-13 13:36:10 -05:00
|
|
|
fedora-release
|
2015-01-12 12:42:18 +01:00
|
|
|
rootfiles
|
2014-07-29 14:30:03 +02:00
|
|
|
vim-minimal
|
2015-03-07 11:12:24 -06:00
|
|
|
dnf
|
2015-03-25 15:33:35 -04:00
|
|
|
dnf-yum # https://fedorahosted.org/fesco/ticket/1312#comment:29
|
2015-10-30 15:06:48 +01:00
|
|
|
sssd-client
|
2014-09-10 13:03:29 -05:00
|
|
|
#fakesystemd #TODO: waiting for review https://bugzilla.redhat.com/show_bug.cgi?id=1118740
|
2014-07-29 14:30:03 +02:00
|
|
|
-kernel
|
|
|
|
|
|
|
|
|
|
|
|
%end
|
|
|
|
|
2017-01-19 14:19:24 -05:00
|
|
|
%post --erroronfail --log=/root/anaconda-post.log
|
2017-01-19 14:24:35 -05:00
|
|
|
set -eux
|
2016-06-08 21:00:09 +02:00
|
|
|
|
2017-01-19 15:30:43 -05:00
|
|
|
# Set install langs macro so that new rpms that get installed will
|
|
|
|
# only install langs that we limit it to.
|
2014-07-29 14:30:03 +02:00
|
|
|
LANG="en_US"
|
2016-11-24 11:15:39 +01:00
|
|
|
echo "%_install_langs $LANG" > /etc/rpm/macros.image-language-conf
|
2015-09-01 15:55:14 -05:00
|
|
|
|
2017-01-19 15:31:38 -05:00
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1400682
|
2014-07-29 14:30:03 +02:00
|
|
|
echo "Import RPM GPG key"
|
|
|
|
releasever=$(rpm -q --qf '%{version}\n' fedora-release)
|
2017-03-10 17:50:40 -06:00
|
|
|
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-primary
|
2014-07-29 14:30:03 +02:00
|
|
|
|
2016-06-07 09:11:29 +02:00
|
|
|
echo "# fstab intentionally empty for containers" > /etc/fstab
|
2015-01-12 12:42:18 +01:00
|
|
|
|
2017-01-19 14:32:47 -05:00
|
|
|
# remove some extraneous files
|
|
|
|
rm -rf /var/cache/dnf/*
|
|
|
|
rm -rf /tmp/*
|
2014-07-29 14:30:03 +02:00
|
|
|
|
2015-01-21 10:17:49 +01:00
|
|
|
#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
|
|
|
|
|
2017-01-19 15:31:38 -05:00
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1343138
|
2016-07-22 15:26:49 -05:00
|
|
|
# Fix /run/lock breakage since it's not tmpfs in docker
|
2017-01-19 15:31:38 -05:00
|
|
|
# This unmounts /run (tmpfs) and then recreates the files
|
|
|
|
# in the /run directory on the root filesystem of the container
|
2016-07-22 15:26:49 -05:00
|
|
|
umount /run
|
|
|
|
systemd-tmpfiles --create --boot
|
|
|
|
|
2016-09-13 08:55:44 +01:00
|
|
|
# Remove machine-id on pre generated images
|
2015-02-06 13:43:59 +01:00
|
|
|
rm -f /etc/machine-id
|
2016-09-27 20:17:46 +01:00
|
|
|
touch /etc/machine-id
|
2015-01-21 10:17:49 +01:00
|
|
|
|
2014-07-29 14:30:03 +02:00
|
|
|
%end
|