Created
December 8, 2017 20:27
-
-
Save faljse/b5d3de03164d41c88b66a270a740eb2f to your computer and use it in GitHub Desktop.
fedora 26 create minimal nspawn container image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -x | |
TARGET="/root/container/f26" | |
dnf -y --releasever=26 --installroot=$TARGET \ | |
install dnf passwd vim-minimal openssh-clients rootfiles fedora-release fedora-repos iproute iputils | |
cat << EOF | chroot $TARGET | |
/bin/cp -f /usr/lib/systemd/network/80-container-host0.network /etc/systemd/network | |
rm -rf /var/cache/dnf/ | |
systemctl enable systemd-networkd | |
systemctl enable systemd-resolved | |
rm -f /etc/resolv.conf | |
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment