fedora-kickstarts/fedora-docker-base.ks
Dennis Gilmore 89abaa8c89 import just the primary rpm gpg key
anaconda apparently fails now if the scriptlet fails which happens
on 32 bit arm:
Error

  There was an error running the kickstart script at line 28.  This is a fatal
  error and installation will be aborted.  The details of this error are:

  + LANG=en_US
  + echo '%_install_langs en_US'
  + echo 'Import RPM GPG key'
  Import RPM GPG key
  ++ rpm -q --qf '%{version}\n' fedora-release
  + releasever=27
  ++ uname -i
  + basearch=armv7l
  + rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-armv7l
  error: /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-27-armv7l: import read failed(2).

  Press ENTER to exit: systemd-localed.service: Got notification message from PID 2286 (STOPPING=1)

as all the rpms in f27 are signed by the sole key lets just import that

Signed-off-by: Dennis Gilmore <dennis@ausil.us>
2017-03-10 10:56:48 -06:00

80 lines
2.6 KiB
Plaintext

# This is a minimal Fedora install designed to serve as a Docker base image.
#
# To keep this image minimal it only installs English language. You need to change
# dnf 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
#
text # don't use cmdline -- https://github.com/rhinstaller/anaconda/issues/931
bootloader --disabled
timezone --isUtc --nontp Etc/UTC
rootpw --lock --iscrypted locked
keyboard us
network --bootproto=dhcp --device=link --activate --onboot=on
reboot
zerombr
clearpart --all
part /boot/efi --fstype="vfat" --size=100
part / --fstype ext4 --grow
%packages --excludedocs --instLangs=en --nocore
bash
tar # https://bugzilla.redhat.com/show_bug.cgi?id=1409920
fedora-release
rootfiles
vim-minimal
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
-kernel
%end
%post --erroronfail --log=/root/anaconda-post.log
set -eux
# Set install langs macro so that new rpms that get installed will
# only install langs that we limit it to.
LANG="en_US"
echo "%_install_langs $LANG" > /etc/rpm/macros.image-language-conf
# https://bugzilla.redhat.com/show_bug.cgi?id=1400682
echo "Import RPM GPG key"
releasever=$(rpm -q --qf '%{version}\n' fedora-release)
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-primary
echo "# fstab intentionally empty for containers" > /etc/fstab
# remove some extraneous files
rm -rf /var/cache/dnf/*
rm -rf /tmp/*
#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
# https://bugzilla.redhat.com/show_bug.cgi?id=1343138
# Fix /run/lock breakage since it's not tmpfs in docker
# This unmounts /run (tmpfs) and then recreates the files
# in the /run directory on the root filesystem of the container
umount /run
systemd-tmpfiles --create --boot
# Remove machine-id on pre generated images
rm -f /etc/machine-id
touch /etc/machine-id
%end