2016-07-22 20:26:49 +00:00
|
|
|
# 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
|
2017-01-23 15:54:01 +00:00
|
|
|
# dnf configuration in order to enable other languages.
|
2015-03-19 21:41:48 +00: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 20:26:49 +00:00
|
|
|
#
|
2015-03-19 21:41:48 +00:00
|
|
|
# Then, once you have imagefactory and imagefactory-plugins installed, run:
|
2016-07-22 20:26:49 +00:00
|
|
|
#
|
2015-03-19 21:41:48 +00: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 12:30:03 +00:00
|
|
|
|
2017-01-19 20:46:44 +00:00
|
|
|
text # don't use cmdline -- https://github.com/rhinstaller/anaconda/issues/931
|
2015-05-15 21:35:52 +00:00
|
|
|
bootloader --disabled
|
2015-01-28 08:38:40 +00:00
|
|
|
timezone --isUtc --nontp Etc/UTC
|
2014-12-16 21:26:01 +00:00
|
|
|
rootpw --lock --iscrypted locked
|
2014-07-29 12:30:03 +00:00
|
|
|
|
|
|
|
keyboard us
|
|
|
|
zerombr
|
|
|
|
clearpart --all
|
2016-04-12 14:43:09 +00:00
|
|
|
part / --fstype ext4 --grow
|
2014-08-20 15:46:56 +00:00
|
|
|
network --bootproto=dhcp --device=link --activate --onboot=on
|
2014-07-29 12:30:03 +00:00
|
|
|
reboot
|
|
|
|
|
|
|
|
%packages --excludedocs --instLangs=en --nocore
|
|
|
|
bash
|
2017-01-04 21:34:16 +00:00
|
|
|
tar # https://bugzilla.redhat.com/show_bug.cgi?id=1409920
|
2015-03-13 18:36:10 +00:00
|
|
|
fedora-release
|
2015-01-12 11:42:18 +00:00
|
|
|
rootfiles
|
2014-07-29 12:30:03 +00:00
|
|
|
vim-minimal
|
2015-03-07 17:12:24 +00:00
|
|
|
dnf
|
2015-03-25 19:33:35 +00:00
|
|
|
dnf-yum # https://fedorahosted.org/fesco/ticket/1312#comment:29
|
2015-10-30 14:06:48 +00:00
|
|
|
sssd-client
|
2014-09-10 18:03:29 +00:00
|
|
|
#fakesystemd #TODO: waiting for review https://bugzilla.redhat.com/show_bug.cgi?id=1118740
|
2014-07-29 12:30:03 +00:00
|
|
|
-kernel
|
|
|
|
|
|
|
|
|
|
|
|
%end
|
|
|
|
|
2017-01-19 19:19:24 +00:00
|
|
|
%post --erroronfail --log=/root/anaconda-post.log
|
2017-01-19 19:24:35 +00:00
|
|
|
set -eux
|
2016-06-08 19:00:09 +00:00
|
|
|
|
2017-01-19 20:30:43 +00:00
|
|
|
# Set install langs macro so that new rpms that get installed will
|
|
|
|
# only install langs that we limit it to.
|
2014-07-29 12:30:03 +00:00
|
|
|
LANG="en_US"
|
2016-11-24 10:15:39 +00:00
|
|
|
echo "%_install_langs $LANG" > /etc/rpm/macros.image-language-conf
|
2015-09-01 20:55:14 +00:00
|
|
|
|
2017-01-19 20:31:38 +00:00
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1400682
|
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
|
|
|
|
|
2016-06-07 07:11:29 +00:00
|
|
|
echo "# fstab intentionally empty for containers" > /etc/fstab
|
2015-01-12 11:42:18 +00:00
|
|
|
|
2017-01-19 19:32:47 +00:00
|
|
|
# remove some extraneous files
|
|
|
|
rm -rf /var/cache/dnf/*
|
|
|
|
rm -rf /tmp/*
|
2014-07-29 12:30:03 +00:00
|
|
|
|
2015-01-21 09:17:49 +00: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 20:31:38 +00:00
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1343138
|
2016-07-22 20:26:49 +00:00
|
|
|
# Fix /run/lock breakage since it's not tmpfs in docker
|
2017-01-19 20:31:38 +00:00
|
|
|
# This unmounts /run (tmpfs) and then recreates the files
|
|
|
|
# in the /run directory on the root filesystem of the container
|
2016-07-22 20:26:49 +00:00
|
|
|
umount /run
|
|
|
|
systemd-tmpfiles --create --boot
|
|
|
|
|
2016-09-13 07:55:44 +00:00
|
|
|
# Remove machine-id on pre generated images
|
2015-02-06 12:43:59 +00:00
|
|
|
rm -f /etc/machine-id
|
2016-09-27 19:17:46 +00:00
|
|
|
touch /etc/machine-id
|
2015-01-21 09:17:49 +00:00
|
|
|
|
2014-07-29 12:30:03 +00:00
|
|
|
%end
|