Containerization

<ol> <li> <p>Create a btrfs backed container populated with a Debian stretch root filesystem downloaded from a template:</p> <pre><code class="language-shell">lxc-create -B btrfs -n webmail -t download -- -d Debian -r Stretch -a $(uname -m)</code></pre> <blockquote> <blockquote> <blockquote> <p>Using BTRFS as a container's backing store requires an underlying host's block device (partition) that is BTRFS formatted too!</p> </blockquote> </blockquote> </blockquote> </li> </ol> <!-- `-B` defines the backing store's file system; `BTRFS` in this case to enable incremental snapshotting. `-n` defines the name of the container; `webmail` in this case. `-t` defines the template to use; `download` in this case to use a predefined one. `-d` defines the distribution; `Debian` in this case. `-r` defines the release; `Stretch` in this case. `-a` defines the architecture; `$(uname -m)` in this case, as it resolves to the architecture of the system it is issued on. --> <!-- !!! Add step giving the container a static IP via config file --> <ol start="2"> <li> <p>Start the container to enable using / shaping its internals in later steps:</p> <pre><code class="language-shell">lxc-start -n webmail</code></pre> </li> <li> <p>Upgrade all packages in the container and install the 'dbus' package within the container to enable easy hostname change:</p> <pre><code class="language-shell">lxc-attach -n webmail -- sh -c "apt update &amp;&amp; apt upgrade -y &amp;&amp; apt install -y dbus rsyslog"</code></pre> </li> <li> <p>Set the container's hostname according to its function for easy identification:</p> <pre><code class="language-shell">lxc-attach -n webmail -- hostnamectl set-hostname webmail</code></pre> </li> </ol> <!-- REFERENCES -->