Docker can report itself installed in a fresh LXC and still not run. This happens when you install it over a non-interactive SSH session. That is exactly what a provisioning script is.
Install docker with command apt-get install docker-ce over a plain SSH command on a freshly
provisioned Ubuntu or Debian LXC. The install partially fails.
dpkg: error processing package docker-ce (--configure):
Then you try to use docker and get this.
Failed to resolve group docker: No such process
docker.socket will not start. The docker group does not exist. The package's own
post-install step is supposed to create that group. It never got that far.
BE WARNED: dpkg -l will still list docker-ce as installed. This reads like a
permissions problem. It is not.
The postinst script for docker-ce wants an interactive debconf frontend. A scripted SSH
session does not have one.
Instead of skipping the interactive parts, the postinst fails partway. The package ends up half configured. Present, but not set up.
Finish the interrupted postinst, then start the pieces it never started.
DEBIAN_FRONTEND=noninteractive dpkg --configure -a
systemctl enable --now docker.socket docker.service
The first command re-runs configuration with the frontend forced. That is what creates the
docker group.
The second brings up the socket and the daemon. Do not assume they start on their own.
Run both fix commands right after the install step. Every time. They are harmless on a container where the install worked.
They save you from debugging a "docker isn't working" report that traces back to a postinst that never finished.