How to stop docker

My OS version is Ubuntu 16.04 . I want to stop the docker, so I run in the terminal:

 sudo systemctl stop docker 

But this command does not help me:

 gridsim1103 ~: ps ax | grep docker 11347 ? Sl 0:00 containerd-shim 487e3784f983274131d37bde1641db657e76e41bdd056f43ef4ad5adc1bfc518 /var/run/docker/libcontainerd/487e3784f983274131d37bde1641db657e76e41bdd056f43ef4ad5adc1bfc518 runc 14299 pts/2 S+ 0:00 grep --color=auto docker 29914 ? S 0:00 sudo dockerd -H gridsim1103:2376 29915 ? Sl 4:45 dockerd -H gridsim1103:2376 29922 ? Ssl 0:24 containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim containerd-shim --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --runtime runc 30107 ? Sl 1:01 /usr/bin/docker-proxy -proto tcp -host-ip 188.184.80.77 -host-port 8500 -container-ip 192.17.0.2 -container-port 8500 30139 ? Sl 0:00 /usr/bin/docker-proxy -proto tcp -host-ip 188.184.80.77 -host-port 8400 -container-ip 192.17.0.2 -container-port 8400 

Docker server version:

 Server: Version: 1.12.1 API version: 1.24 (minimum version ) Go version: go1.6.2 Git commit: 23cf638 Built: Tue, 27 Sep 2016 12:25:38 +1300 OS/Arch: linux/amd64 Experimental: false 

I also tried unsuccessfully:

  sudo service docker stop 
+41
source share
2 answers

The ps aux output looks like you did not start docker through systemd / systemctl.

It looks like you started with:

 sudo dockerd -H gridsim1103:2376 

When you try to stop it with systemctl, nothing should happen, since the resulting docker process is not controlled by systemd. So the behavior you see is expected.

The correct way to start docker is to use systemd / systemctl:

 systemctl enable docker systemctl start docker 

After that, the docker starts at system startup.

EDIT. Since you already have a docker process, just kill it by pressing CTRL + C on the terminal on which you started it. Or send an error signal to the process.

+43
source

In my case, it was neither a systemd nor a cron job, but it was easy. So I had to run:

 sudo snap stop docker sudo snap remove docker 

... and the last team never really ended, I don’t know why: this thing really hurts. And I ran too:

 sudo apt purge snap 

:-)

+2
source

Source: https://habr.com/ru/post/1264509/


All Articles