Systemd/Nspawn: Difference between revisions
From Bibliotheca Anonoma
Antonizoon (talk | contribs) (Created page with "Sometimes I need to do development using a Debian-based system, but I usually use Arch or Fedora. Thus, I set up a chroot to run such systems with no performance loss. Heck,...") |
Antonizoon (talk | contribs) (→nSpawn) |
||
Line 30: | Line 30: | ||
https://gist.github.com/aputs/0476fd313a86c66a6927 | https://gist.github.com/aputs/0476fd313a86c66a6927 | ||
#!/bin/bash | |||
# boot the container as given in first argument | |||
sudo systemd-nspawn -d "$1" --boot | |||
== Docker == | == Docker == |
Latest revision as of 20:40, 30 January 2018
Sometimes I need to do development using a Debian-based system, but I usually use Arch or Fedora.
Thus, I set up a chroot to run such systems with no performance loss. Heck, I even throw in systemd-nspawn to spice things up.
Installation[edit]
Fedora[edit]
su -c 'dnf install debootstrap dpkg'
http://blog.parahard.com/2013/03/creating-debian-chroot-inside-fedora.html
Usage[edit]
You can set up multiple types of distros under the chroot.
Debian[edit]
debootstrap --arch=amd64 unstable debian-tree/
http://blog.exppad.com/article/a-docker-like-container-management-using-systemd
Management[edit]
Systemd provides some helpful utilities to manage containers:
machinectl[edit]
https://wiki.archlinux.org/index.php/Systemd-nspawn#machinectl
nSpawn[edit]
https://gist.github.com/aputs/0476fd313a86c66a6927
#!/bin/bash # boot the container as given in first argument sudo systemd-nspawn -d "$1" --boot
Docker[edit]
https://docs.docker.com/engine/userguide/dockerimages/
Docker does all of this for you.