Docker的守护进程一直运行,
yw1989@ubuntu:~$ ps -ef | grep docker : 就是docxker的守护进程
root 1833 1 0 17:18 ? 00:00:45 /usr/bin/dockerd -H fd://
yw1989@ubuntu:~$ docker version : 敲命令行就是docker的client与守护进程交互
Client:
Version: 18.01.0-ce
API version: 1.35
Go version: go1.9.2
Git commit: 03596f5
Built: Wed Jan 10 20:11:05 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.01.0-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.2
Git commit: 03596f5
Built: Wed Jan 10 20:09:37 2018
OS/Arch: linux/amd64
Experimental: false
root@ubuntu:/# nc -U /var/run/docker.sock : 连接进了socket
Docker守护进程的配置:
$ps -ef | grep docker
$sudo service docker stats
使用service命令:
$sudo service docker start
$sudo service docker stop
$sudo service docker restart
修改了docker的配置就需要重新启动。
yw1989@ubuntu:/$ ps -ef | grep docker
root 50742 1 0 00:26 ? 00:00:01 /usr/bin/dockerd -H fd://
root 50756 50742 0 00:26 ? 00:00:03 docker-containerd --config /var/run/docker/containerd/containerd.toml
yw1989 52300 52274 0 01:04 pts/2 00:00:00 grep --color=auto docker
yw1989@ubuntu:/$ service docker stop
yw1989@ubuntu:/$ ps -ef | grep docker : 停止后就没有
yw1989 52355 52274 0 01:05 pts/2 00:00:00 grep --color=auto docker
root@ubuntu:/# service docker restart : 重启后就又有了
root@ubuntu:/# ps -ef | grep docker
root 53633 1 0 01:11 ? 00:00:00 /usr/bin/dockerd -H fd://
root 53650 53633 0 01:11 ? 00:00:00 docker-containerd --config /var/run/docker/containerd/containerd.toml
root 53766 53587 0 01:12 pts/2 00:00:00 grep --color=auto docker
Docker守护进程启动的配置选项:
Docker服务的启动并不是通过命令行启动的,重要的配置文件/etc/defult/docker。