docker服務和配置文件


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

https://www.cnblogs.com/tylerzhou/p/11100649.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM