Benefits of running Portainer docker management framework nested within an LXC container on Proxmox are:
- Less memory and cpu resource overhead
- Modifying the virtual hardware resouces assigned to the LXC container can be done without having to reboot, as would be necessary when using a traditional VM
These benefits allow one to provision more services given the same hardware resources — especially in ram-limited systems — and maintain higher uptime for their docker-based microservices.
Note: Before using this repo, make sure your Proxmox host is up to date.
To setup a new Portainer installation within a new LXC container on your Proxmox host, download the install script to your Proxmox host's console:
wget -qL https://github.com/fiveangle/proxmox_portainer_lxc/raw/master/create_container.sh
Edit create_container.sh
to set your desired container disk size, hostname, portainer version, etc, then start the installation with:
bash create_container.sh
Docker appears to have a bug when running in an LXC on a ZFS-backed datastore as it will not enable the native ZFS driver for /var/lib/docker, instead trying to use the AUFS driver (and failing). To work-around the issue, after installation using this script, perform the following:
- set the docker services to disabled in the LXC container (e.g. systemctl stop docker; systemctl disable docker)
- rename your existing /var/lib/docker dir to something else like docker_old
- stop the LXC container
- in Proxmox gui create a new storage mount point at /var/lib/docker for the container from your ZFS thin zpool
- start the container and move all contents within your renamed /var/lib/docker_old dir to the new mount point at /var/lib/docker
- re-enable and restart docker services (e.g. systemctl enable docker; systemctl start docker)
Enjoy !
-=dave