如何在Linux下停止Docker [英] How to stop docker under Linux

查看:1101
本文介绍了如何在Linux下停止Docker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的OS版本 Ubuntu 16.04
我想停止docker,所以我在终端上运行:

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

sudo systemctl stop docker

但是此命令对我没有帮助:

But this commands doesn't 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:      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

我也尝试失败:

 sudo service docker stop


推荐答案

ps aux的输出似乎没有通过systemd / systemctl启动docker。

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

似乎是从以下位置启动的:

It looks like you started it with:

sudo dockerd -H gridsim1103:2376

当您尝试使用systemctl停止它时,什么也不应该发生,因为生成的dockerd进程不是由systemd控制。因此,您所看到的行为是预期的。

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

启动docker的正确方法是使用systemd / systemctl:

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

systemctl enable docker
systemctl start docker

之后

编辑:由于您已经在运行docker进程,只需在启动它的终端上按CTRL + C即可将其杀死。或向进程发送终止信号。

As you already have the docker process running, simply kill it by pressing CTRL+C on the terminal you started it. Or send a kill signal to the process.

这篇关于如何在Linux下停止Docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆