when installed docker.io , /etc/init.d/docker not found, so service can't start

Bug #1878324 reported by Pigo Chu
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubuntu WSL
Confirmed
Medium
Unassigned
docker.io (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

I executed the following command

sudo apt install docker.io
sudo service docker start

than show message
docker: unrecognized service

I check /etc/init.d/docker , no file.

I also try other app.

sudo apt remove openssh-server
rm /etc/init.d/ssh
sudo apt install openssh-server

the /etc/init.d/ssh also not found

Win10: build 19624
ubuntu 20.04 WSL2 mode.

Suspicious message
invoke-rc.d: could not determine current runlevel
invoke-rc.d: unknown initscript, /etc/init.d/docker not found.

===========================================================
Setting up cgroupfs-mount (1.4) ...
invoke-rc.d: could not determine current runlevel
Setting up containerd (1.3.3-0ubuntu2) ...
Setting up docker.io (19.03.8-0ubuntu1) ...
invoke-rc.d: unknown initscript, /etc/init.d/docker not found.
invoke-rc.d: could not determine current runlevel
Setting up dnsmasq-base (2.80-1.1ubuntu1) ...
Setting up ubuntu-fan (0.12.13) ...
invoke-rc.d: could not determine current runlevel
Processing triggers for systemd (245.4-4ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

Revision history for this message
Pigo Chu (pigochu) wrote :

Sorry , ubuntu version is 20.04

Revision history for this message
Patrick Wu (callmepk) wrote :

Could you also post your Windows 10 version? Also, what version of WSL are you using? Just for your information, WSL1 do not support Docker at all.

Revision history for this message
Pigo Chu (pigochu) wrote :

Win10: build 19624
I run ubuntu in WSL2 mode.

Revision history for this message
Pigo Chu (pigochu) wrote :

Suspicious message
invoke-rc.d: could not determine current runlevel
invoke-rc.d: unknown initscript, /etc/init.d/docker not found.

===========================================================
Setting up cgroupfs-mount (1.4) ...
invoke-rc.d: could not determine current runlevel
Setting up containerd (1.3.3-0ubuntu2) ...
Setting up docker.io (19.03.8-0ubuntu1) ...
invoke-rc.d: unknown initscript, /etc/init.d/docker not found.
invoke-rc.d: could not determine current runlevel
Setting up dnsmasq-base (2.80-1.1ubuntu1) ...
Setting up ubuntu-fan (0.12.13) ...
invoke-rc.d: could not determine current runlevel
Processing triggers for systemd (245.4-4ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for dbus (1.12.16-2ubuntu2) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...

Pigo Chu (pigochu)
description: updated
Patrick Wu (callmepk)
Changed in ubuntuwsl:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Patrick Wu (callmepk) wrote :

I can confirm this bug. For now, it would be a good idea to use the Windows Docker Desktop with WSL2 backend to use both on Windows and WSL2: https://docs.docker.com/docker-for-windows/wsl-tech-preview/

Revision history for this message
Pigo Chu (pigochu) wrote :

Thanks Patrick Wu . I am still playing docker on wsl2 , I can copy docker init script from other machine and it works fine.

Revision history for this message
Paolo Mainardi (paolomainardi) wrote :

Same bug on Ubuntu 18.04 on Win10 + wsl2, it is basically impossible now to run docker on ubuntu distro on wsl2. To me, it's more than "Medium".

Revision history for this message
Pigo Chu (pigochu) wrote :

Paolo Mainardi

officile docker-ce can be installed , now has 20.04 version. so I remove docker.io and install it.

https://docs.docker.com/engine/install/ubuntu/ <= document show lastest is 18.0.4

Revision history for this message
ALIAKSEI VENSKI (spellbound6666) wrote :

The same issue for me...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in docker.io (Ubuntu):
status: New → Confirmed
Revision history for this message
Bryce Harrington (bryce) wrote :

systemd is used in Ubuntu 20.04 for managing services. Some things still work with the legacy init system but in general you should be using commands like:

$ sudo apt install docker.io
$ sudo systemctl start docker
$ sudo systemctl status docker

Let us know if that does not work.

Changed in docker.io (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Pigo Chu (pigochu) wrote :

Hi bryce ~

This bug happend on WSL2.
So I use servce docker start/stop ...
No systemd and can't use systemd

Revision history for this message
q4a (q4a) wrote :

Same here on WSL2 with Ubuntu 20.04. After
`$ sudo apt install docker.io`
I can't run docker service, but `docker-ce` from this manual
https://docs.docker.com/engine/install/ubuntu/
works fine.

Revision history for this message
Pranav Athreya (pranavathreyaexos) wrote :

Installing this way works for me as well on wsl: https://docs.docker.com/engine/install/ubuntu/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.