Docker on LXC in Proxmox
December 31, 2024
Docker on LXC
As covered in the previous post here, LXC offers a different form of containerisation to Docker. Docker containers are immutable and reset when restarted, whereas LXC are more closely coupled with their storage.
Each container technology has a different best-use case, but it is possible to combine the two in a practical application, and to do so on Proxmox.
Setting up Docker on LXC
-
Create your LXC container as normal - see Proxmox LXC post here.
-
Update the LXC container package registry. Eg, for ubuntu:
apt-get update
apt-get upgrade
- Install docker community edition (Ubuntu)
apt-get install docker.io
When the installation completes, you should be able to use docker as normal. Eg:
docker run hello-world
Note: In order to access services running in Docker containers, you will need to know the IP address of the LXC container. “ip address” will show this on Ubuntu and some other Linux variants.
The setup Docker on an Ubuntu LXC container is demonstrated below: