Skip to content

Instantly share code, notes, and snippets.

@afanjul
Last active June 14, 2023 18:08
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save afanjul/492ca7b10982f6de2cb2c475fe76af6a to your computer and use it in GitHub Desktop.
Save afanjul/492ca7b10982f6de2cb2c475fe76af6a to your computer and use it in GitHub Desktop.
Install Docker inside LXC container - Proxmox VE
1.Add “aufs” or “overlay” (or both) to /etc/modules-load.d/modules.conf in your PVE host and reboot. Check it with lsmod | grep -E 'overlay|aufs'
2.Use a LXC image with unprivilege features (you can check them here: https://uk.images.linuxcontainers.org/)
3.Create the container with unprivilege option, and “keyctl=1, nesting=1” features (Options section in proxmox).
4.Maybe you would want to mount an external point into /var/lib/docker (Resources section in proxmox)
5.Check this link (https://docs.docker.com/storage/storagedriver/overlayfs-driver/#configure-docker-with-the-overlay-or-overlay2-storage-driver) to change your storage-driver in docker to use aufs or overlay2.
6.Install portainer: https://portainer.readthedocs.io/en/latest/deployment.html
Voilá…
@clicks
Copy link

clicks commented Jun 3, 2021

Please note that overlay/overlay2 won't when ZFS is used as the underlying filesystem. It will cause following error on the Proxmox Host:
kernel: overlayfs: filesystem on '/var/lib/docker/check-overlayfs-support458510559/upper' not supported as upperdir

@c-goes
Copy link

c-goes commented Sep 11, 2021

Please note that overlay/overlay2 won't when ZFS is used as the underlying filesystem. It will cause following error on the Proxmox Host:
kernel: overlayfs: filesystem on '/var/lib/docker/check-overlayfs-support458510559/upper' not supported as upperdir

It's possible to use fuse-overlayfs https://c-goes.github.io/posts/proxmox-lxc-docker-fuse-overlayfs/

@timdonovanuk
Copy link

"install a static version of fuse-overlayfs" any more info on this would be welcome. The rest of the steps are quite self explanatory but this is very much "just draw the rest of the damn owl" territory.

@c-goes
Copy link

c-goes commented Sep 12, 2021

"install a static version of fuse-overlayfs" any more info on this would be welcome.

It's a single binary you can copy to /usr/local/bin/fuse-overlayfs available at https://github.com/containers/fuse-overlayfs/releases
Docker should work as soon as you can call fuse-overlayfs --version.
There is also the fuse-overlayfs package in ubuntu but it's maybe too old. But should work as well.

@timdonovanuk
Copy link

Thank you! <3

@Hornochs
Copy link

Please note that overlay/overlay2 won't when ZFS is used as the underlying filesystem. It will cause following error on the Proxmox Host:
kernel: overlayfs: filesystem on '/var/lib/docker/check-overlayfs-support458510559/upper' not supported as upperdir

It's possible to use fuse-overlayfs https://c-goes.github.io/posts/proxmox-lxc-docker-fuse-overlayfs/

Hey there,

wanted to pop bye te tell you that your Blogpost helped me fixing my issues as discussed here: https://forums.docker.com/t/docker-daemon-stops-from-time-to-time

Wanted to tell you, since you don't allow comments on your blog, that for me it worked on Proxmox only with nesting and FUSE enabled. The other features are not needed in my case.

Cheers!

@kmadaras
Copy link

kmadaras commented Apr 1, 2023

Fuse-Overlay seems to break Proxmox Backups, I haaven't found a solution yet, but it cannot backup the /var/lib/docker/fuse-overlay/ directory in full with this config.

@Hornochs
Copy link

Hornochs commented Apr 1, 2023

Aaaah that’s the reason, I see. Well my fix was to backup with the stop mode, not Snapshot or suspend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment