Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (2.3k points)

So I've been trying to stop docker. I used both systemctl stop & service stop commands for it:

$sudo systemctl stop docker
$sudo service docker stop 

But its not working, Docker is still running:

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

This is the version of Ubuntu I am using: Ubuntu 16.04.

And this is the version of my docker server:

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

1 Answer

0 votes
by (6.9k points)

The issue here is that, the docker you started was not using systemd/systemctl but rather: 

sudo dockerd -H gridsim1103:2376

which means that you cannot stop it using systemctl command, and the result you see is expected.

You should start docker using systemd/systemctl as that is the standard or correct way to start up docker.

$systemctl enable docker
$systemctl start docker

The first command basically tell docker to startup every time you boot into the host.

To stop the docker process that is already running you can just press ctrl + c or send a kill signal to it.

OR

if you were using snap instead you try these commands:

$sudo snap stop docker
$sudo apt purge snap

Hope this helped :)


Docker can be tough to learn without oversight or professional help. Try docker training course , you will be taught by industry veterans who have set out to help other to learn docker.

Related questions

0 votes
1 answer
0 votes
4 answers
0 votes
1 answer
asked Oct 10, 2019 in Python by Sammy (47.6k points)

Browse Categories

...