From 90c5b266ea909ec41ff221174302b1fb71f6db8f Mon Sep 17 00:00:00 2001 From: Vasudev Kamath Date: Mon, 9 Nov 2015 17:01:46 +0530 Subject: New post on systemd-nspawn --- content/devops/containers_using_systemd-nspawn.rst | 324 +++++++++++++++++++++ 1 file changed, 324 insertions(+) create mode 100644 content/devops/containers_using_systemd-nspawn.rst (limited to 'content/devops') diff --git a/content/devops/containers_using_systemd-nspawn.rst b/content/devops/containers_using_systemd-nspawn.rst new file mode 100644 index 0000000..f5a71fe --- /dev/null +++ b/content/devops/containers_using_systemd-nspawn.rst @@ -0,0 +1,324 @@ +Taming systemd-nspawn for running containers +############################################ + +:date: 2015-11-09 12:52 +:slug: taming_systemd_nsapwn +:tags: systemd-nspawn, containers, debian +:author: copyninja +:summary: Brief notes on maintaining container using systemd-nspawn + +I've been trying to run containers using systemd-nspawn for quite some +time. I was always bumping to one or other dead end. This is not +systemd-nspawn's fault, rather my impatience stopping me from reading +manual pages properly lack of good tutorial like article available +online. Compared to this LXC has a quite a lot of good tutorials and +howto's available online. + +This article is my effort to create a notes putting all required +information in one place. + + +Creating a Debian Base Install +============================== + +First step is to have a minimal Debian system some where on your hard +disk. This can be easily done using *debootsrap*. I wrote a custom +script to avoid reading manual every time I want to run +debootstrap. Parts of this script (mostly packages and the root +password generation) is stolen from *lxc-debian* template provided by +lxc package. + +.. code-block:: shell + + #!/bin/sh + + set -e + set -x + + usage () { + echo "${0##/*} [options] []" + echo "Bootstrap rootfs for Debian" + echo + cat <