Best way to run Docker in Proxmox?
I found this guide here:
The authors themselves call the set-up a "security nightmare" and unsuitable for production mode.
So my question is, does anybody know of a reliable way to run docker containers in Proxmox?
I'm looking to deploy Zoneminder and their "easiest" method is with a docker image:
https://zoneminder.readthedocs.io/en/1.34.9/installationguide/easydocker.html
I'm not sure if there's any benefit to running the docker image directly vs. running a docker container inside an Ubuntu server VM vs. just installing Zoneminder straight on the VM. I'm going to post over in r/ZoneMinder and ask.
I have ~10 LCXs,2 VMs and around 10 docker containers running in proxmox.
When I started with my homelab I found the same article you posted and it threw my away from the idea.
However docker containers have their use cases. I settled for a Debian lxc in proxmox with nesting feature enabled and running the containers in there. On the proxmox instance you have to enable the overlay and aufs Kernel models otherwise the lxc will quickly run out of space. To do that:
After that create an unprivileged container
This is my Debian docker lxc config:
You have to add the last line after you created the lxc. The file is located under /etc/pve/<ct_id>.conf It's is due to a bug. It could be fixed now have to check it in the future.
In the container this is how I installed docker and changed the storage type to overlay:
Try it out, works flawlessly for me. This way you have to "normal" security concerns with lxc/lxd. Docker runs in a separate lxc and not directly on the host. This also has the benefit that you can easily backup the whole lxc and restore it easily
Comment deleted by user
This would make a great blog post, thanks for sharing!
I run my docker containers in a stripped down debian VM.
I just can't imagine how much of a nightmare running docker on the host would be.
It's so much easier to manage, secure, and backup with that layer of abstraction.
+1 to just spin up Debian vm and do whatever you want in there.
I run docker in a debian VM.
I prefer to leave the Proxmox host with only Proxmox and minimal fiddling. Everything runs in a VM or a CT.
The best way would be to spin up a VM (pick your image at your liking, RancherOS is popular for a 100% docker VM otherwise Debian or minideb is just fine).
I agree with running it in a Debian VM, just wanted to add you may wanna try out RancherOS as well.
I'd... not?
I know, I know, it says 'easiest'... but you've got containers *right there*. Just set up an entirely dedicated debian/ubuntu instance in a container directly to do the same thing. I've found this with a lot of Docker stuff; it's actually 'easier' to harden a Debian install how I want it, then setup whatever packages I need, and pull up the software I want directly in the CT.
A lot if services are a lot easier to spin up as docker containers. Like 1 command to run Nexctloud VS 2 pages of instructions on setting it up with all deps and nginx and such. Just virtualize docker host as separate VM or CT and ot works great.