LXD and Docker containers serve different purposes. LXD runs system containers that are VM-like and systems running on them are intended to be long-running and persistent. Docker containers, on the other hand, are usually stateless and ephemeral, and are a great options for distributing working solutions. You can use LXD to create your virtual systems running inside the containers, segment it as you like, and then easily use Docker to get the actual service running inside of the container.
This tutorial teaches you how to run Docker inside LXD containers, which you can then use the same way as you usually would running on any other system.
What you’ll learn
How to create an LXD container with a Docker compatible file system
How to install Docker inside an LXD container
What you’ll need
Ubuntu Desktop 16.04 or above
LXD snap installed and running
Some basic command-line knowledge