Rootfull docker inside unprivileged LXD container

Hello,

Is it possible to run docker inside unprivileged LXD container?

The motivations comes from the fact the projects like Nextcloud are providing docker images. These images can be easily kept upto date automatically using tools like watchtower. The upstream provided images are possibly more reliable than the distro provided builds. My LXD containers need manual intervention to update unlike docker/watchtower.

Thanks

Take a look at Running Docker inside of a LXD container - YouTube it may help you

Hi!

You can use Docker in a unprivileged container

But, you have to use Nested containers

Example
lxc launch ubuntu:22.04 nextcloud -c security.nesting=true

Or to change an existing container:
lxc config set nextcloud security.nesting true

Regards.

https://ubuntu.com/blog/nested-containers-in-lxd

PS: You can also use Docker in a privileged container :slight_smile:

You dont need to use a privileged container, see

https://www.youtube.com/watch?v=_fCSSEyiGro

1 Like