Docker¶
Docker is a containerization platform to easy deploy software. That makes updating and testing so much easier. Even though most of the software alsready runs in LXC containers, nesting docker can provide significant improvements.
Setting up Docker for a LXC container¶
First, to set up docker in a LXC container, nesting=1 and keyctl=1 should be set in the container options. Next, you need to install the docker in the container (done here for Debian, please also check the official documentation):
$ apt update
$ apt install ca-certificates curl gnupg lsb-release
$ curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
$ apt update
$ apt install docker-ce docker-ce-cli containerd.io
Install docker-compose¶
If you need to use docker-compose as well, you can install it like so (official documentation):
$ curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ chmod +x /usr/local/bin/docker-compose