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
4、docker功能
build,ship,run
https://zhuanlan.zhihu.com/p/150670253?from_voters_page=true