Skip to content

Instantly share code, notes, and snippets.

@faljse
Created December 8, 2017 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faljse/b5d3de03164d41c88b66a270a740eb2f to your computer and use it in GitHub Desktop.
Save faljse/b5d3de03164d41c88b66a270a740eb2f to your computer and use it in GitHub Desktop.
fedora 26 create minimal nspawn container image
#!/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