79633945

Date: 2025-05-22 14:25:30
Score: 1.5
Natty:
Report link

You need WSL's latest version!

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.

Symptoms of having this problem:

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?.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: user20085