Docker initially used LXC (Linux Containers) as a container runtime interface and the two were often used interchangeably. However, Docker later developed its own library, known as ‘libcontainer.’ As the Docker functionality grew, it moved away from LXC, and as of version 0.9 Docker no longer uses LXC within its stack.
Nevertheless, if you still want to use Docker with LXC, you can do so by configuring the Docker daemon to use LXC. Please note, this is not a recommended or popular use case.
Docker still supports the LXC driver, but only as an optional plugin. You can configure Docker to use LXC with the following steps:
1. Make sure Docker is installed in your system.
1. Edit or create the /etc/docker/daemon.json file. In the json, set the exec-opts to LXC:
```
{
“exec-opts”: [“native.cgroupdriver=systemd”],
“log-driver”: “json-file”,
“log-opts”: {
“max-size”: “100m“
},
“storage-driver”: “overlay2”,
“storage-opts”: [
“overlay2.override_kernel_check=true“
]
}
```
1. Start Docker with the LXC driver:
```
dockerd —exec-opt lxc
```
Note: Docker’s use of the LXC driver is not maintained or tested anymore, and its support may be dropped in future Docker versions. It’s recommended to use Docker’s default runtime, runc, or another OCI compatible runtime like crun, or kata-containers, etc.