In the course of migrating some services from very old openVZ machines I decided to use a powerful KVM Host with Proxmox to manage some applications in LXC and docker.
With my openITCOCKPIT installation, the migration to an LXC did not work using LXC default settings!
openITCOCKPIT needs to create own docker containers, but using docker in LXC wasn´t as easy as I thought.
After some annoying hours I got it working and in the end it wasn't that hard to set up :)
Now it´s my productive setup.
If you either want to try an installation, make sure the following points are suffused and follow the steps below.
You should have root access to the LXC host (tested with Proxmox LXC)
You can create a container on local storage (as raw file)
You have internet access ;)
1. Install docker-ce on the host system (Link to the docker documentation)
2. Create a privileged container
This can not be changed after container creation.
I recommend choosing a current Ubuntu or Debian template. (Unfortunately openITCOCKPIT does not currently support Debian 10)
3. Choose local storage with storage type 'dir' to create a raw image! (zfs or lvm did´t work in my case!)
4. Give the container 2 CPU cores (x86-64), 2 GB RAM, a little swap if you want and 20 GB storage (as in my current setup)
5. After creation, edit the configuration file of your new container
/etc/pve/lxc/$ID.conf on your host machine. Replace $ID with your container id (e.g. 204).
If you don´t use Proxmox, your configuration file is in a different path.
Maybe you can edit it using the lxc command and your container name ($NAME)
lxc config edit $NAME
Add this line:
6. Start the new container and run the default openITCOCKPIT installation
I wanted to save up money (and ressources)!
You could also pass the host's docker socket into the container so that the containers from openITCOCKPIT are set up directly on the host machine, but running docker in LXC makes it easier to update, save or remove the openITCOCKPIT instance.