0

I was installing docker in my Jupyter notebook for my project using the commands from this link. I installed the docker using the command

!sudo apt install docker-ce

but after that when I tried to check the status of the docker using the command.

!sudo systemctl status docker

I got the following error.

System has not been booted with systemd as init system (PID 1). Can't operate.

I saw answers for such questions in links but it is not solving my problem. For the following command

!service --status-all

I am getting the following result of which I have no idea. Can someone help me in explaining what I am missing?.

 [ - ]  dbus
 [ ? ]  hwclock.sh
 [ ? ]  kmod
 [ - ]  procps
 [ - ]  rsync
 [ + ]  udev
 [ - ]  x11-common

This may be trivial for some of you. Any help will be highly appreciated.

Saurav Rai
  • 2,171
  • 1
  • 15
  • 29

1 Answers1

0

You may try an image that has Ubuntu with System D already active with this command:

docker run -d --name systemd-ubuntu --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro jrei/systemd-ubuntu

Then you just need to run:

docker exec -it systemd-ubuntu /bin/bash

and there you can just install, start and restart any service you need.

Carlos Saltos
  • 1,385
  • 15
  • 15