Docker needs invoke-rc.d to install correctly, which in turn needs systemd, which in turn needs newer versions of WSL to be present. For me, I just had to update WSL :
wsl --update
Check that systemd is installed correctly inside your WSL distro:
systemctl
Then reinstall docker as usual.
You are seeing this line when installing docker (toward the end of installation a few lines before the end):
invoke-rc.d: could not determine current runlevel
Doing the systemctl
command gives you this:
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
Docker daemon won't start after doing sudo service docker restart
, and trying to run a container or sudo docker info
will show:
Cannot connect to the Docker daemon at
unix:///var/run/docker.sock
. Is the docker daemon running?.