First of all, the obligatory caveat from 2023 where Proxmox developers discourage running Docker in LXC. Upgrades to Proxmox may break 'something', which will require remediation of the containers. The relationship between Proxmox, LXC and Docker is brittle.
And I totally agree not to install Docker directly on the Proxmox host, as Docker will conflict with many networking and functional operations.
However, the combination is just too enticing. What other mechanism is available to compartmentalize applications and provide GPU resources to each compartmentalized application? Putting LXC and Docker into a VM seems a bit 'heavy' just for the sake of softening some brittleness. All the same management has to take place within the VM.
Given the caveat, I'll see if I can make this work. Not so easy. Trying to run
docker run --rm hello-world
Yields an error:
docker: Error response from daemon: failed to mount /tmp/containerd-mount2030888385: mount source: "overlay", target: "/tmp/containerd-mount2030888385", fstype: overlay, flags: 0, data: " workdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3/work, upperdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/3/fs, lowerdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/2/fs,userxattr", err: permission denied
With an associated apparmor error in Proxmox:
audit: type=1400 audit(1774803476.655:145): apparmor="DENIED" operation="mount" class="mount" info="failed perms check" error=-13 profile="lxc-131_" name="/tmp/containerd-mount2030888385/" pid=1480790 comm="dockerd" fstype="overlay" srcname="overlay"
The simple solution is to set nesting=1 in the proxmox lxc options.
The next hurdle is that it may take a couple/several minutes for the Docker file to run when the container starts up. If so, you may see this:
> ps aux root 41 0.0 0.0 2680 1808 ? Ss 20:09 0:00 /bin/sh /usr/lib/ifupdown/wait-online.sh
If so, this can be disabled:
systemctl disable ifupdown-wait-online.service
In addition, systemd-networkd-wait-online may be waiting for an interface it doesn't manage. This will cause a startup delay of several minutes. Use the following to add some debugging and logging
systemctl edit systemd-networkd-wait-online.service [Service] Environment=SYSTEMD_LOG_LEVEL=debug
In my case, I then saw something like:
root@frigate01:~# systemctl status systemd-networkd-wait-online.service ● systemd-networkd-wait-online.service - Wait for Network to be Configured Mar 29 20:38:44 frigate01 systemd-networkd-wait-online[97]: lo: link is ignored Mar 29 20:38:44 frigate01 systemd-networkd-wait-online[97]: vlan60: link is not managed by networkd.
I have used a non-standard interface name. I resolved this by updating the edit with the following:
> systemctl edit systemd-networkd-wait-online.service [Service] ExecStart= ExecStart=/usr/lib/systemd/systemd-networkd-wait-online --interface=vlan60 #Environment=SYSTEMD_LOG_LEVEL=debug
The empty ExecStart line clears the original command parameters.
- How to Fix systemd-networkd-wait-online Service Timing Out During Boot
- systemd-networkd-wait-online.service(8) — Linux manual page
Some Docker commands:
docker run --rm -it hello-world bash


