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: swarmServer: 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: falseroot@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 dockerroot 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.tomlyw1989 52300 52274 0 01:04 pts/2 00:00:00 grep --color=auto dockeryw1989@ubuntu:/$ service docker stopyw1989@ubuntu:/$ ps -ef | grep docker : 停止后就没有yw1989 52355 52274 0 01:05 pts/2 00:00:00 grep --color=auto dockerroot@ubuntu:/# service docker restart : 重启后就又有了root@ubuntu:/# ps -ef | grep dockerroot 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.tomlroot 53766 53587 0 01:12 pts/2 00:00:00 grep --color=auto dockerDocker守护进程启动的配置选项:
Docker服务的启动并不是通过命令行启动的,重要的配置文件/etc/defult/docker。