commit 27bbad5d9aa66e29352aea95443a91cd6c6094b3
parent b54175d5acdf9bc1f52694e57908eaa35d5ccc56
Author: pyratebeard <root@pyratebeard.net>
Date: Thu, 27 Jan 2022 21:42:53 +0000
multi_lxc_with_haproxy
Diffstat:
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/entry/multi_lxc_with_haproxy.md b/entry/multi_lxc_with_haproxy.md
@@ -1,8 +1,25 @@
-Near the beginning of last year I hit a few issues with some of my docker containers and part of my CI/CD pipeline. Around the same time I seemed to be reading more about LXC, and a few people on IRC mentioned it. I decided to take a step back from Docker and give LXC a go.
+Near the beginning of last year I hit a few issues with some of my Docker containers and part of my CI/CD pipeline. Around the same time I seemed to be reading more about LXC, and a few people on IRC mentioned that it was worth learning. I decided to take a step back from Docker and give LXC a go.
## what the chroot
LXC or Linux Containers, is a virtualisation method allowing the kernel to be used between multiple environments or containers. While traditionally with Docker you would run applications inside a container then network them together (web server, database, etc.) LXC gives you a "full" Linux system but unlike a virtual machine it shares the same kernel as the host.
There are pros and cons to LXC but I don't want to get into that in this post. If you would like to know more about LXC check out the [official website](https://linuxcontainers.org). I should also point out that I have stuck with LXC and not LXD, which is a next generation container manager.
+Setting up LXC is straightforward.
+
+Then you can create a container, selecting an image from the list shown.
+
+After I created the container I started it and set it up as I would any other system. This then became my "base image". Any new container I wanted could be cloned from this so it is already set up. I renew the base image periodically with updates etc.
+
+To make a clone of a container incant
+```
+```
+
+This command is _suppose_ to change the hostname of the cloned container but I found it didn't. To remedy that incant
+```
+```
+
## virtualise all the things
+I was using Docker to run a number of things on a single VPS, using an Nginx container as a proxy.
+
+For no particular reason, with LXC I opted for Haproxy. The VPS I am using runs Debian, but I chose Devuan for the containers so I didn't have to use systemd.