1 、dockerd & 启动docker 后如何停止。
先找到dockerd 运行的pid
cat /etc/run/docker.pid
比如是pid是 123
kill -9 pid
删除文件
rm /etc/run/docker.pid
2、设置开机自动启动
配置service
vi /usr/lib/systemd/system/docker.service
[Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=infinity LimitNPROC=infinity TimeoutStartSec=0 Delegate=yes KillMode=process Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target
systemctl daemon-reload
systemctl start docker.service
systemctl enable docker.service #自动启动
输出如下
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service
3、docker配置文件
vi /etc/docker/docker.jason
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
4、docker,build,ship,run