離線安裝docker


離線安裝Docker

1. 二進制安裝

二進制下載地址

1. 下載離線包
2. 解壓
 tar -zxvf docekr-xxx.tgz
 3. 復制壓縮后的文件到指定文件夾
 cp docker/* /usr/bin
 4. 注冊編輯docker服務
 vim /etc/systemd/system/docker.service
 5. 添加可執行權限
 chmod +x /etc/systemd/system/docker.service
 6. 一鍵三連
 systemctl daemon-reload 
 systemctl start docker
 systemctl enable docker.service # 設置開機自啟動

參考docker.service

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
#ExecStart=/usr/bin/dockerd --privileged=true --default-ulimit nofile=65536:65536 -H fd:// 
ExecStart=/usr/bin/dockerd

ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

2. docker 卸載

1. 停掉docker服務
	systemctl stop docker
2. 查看yum安裝的docker文件包
	yum list installed |grep docker
3. 刪除所有安裝的docker文件包
	yum -y remove docker.x86_64
4. 查看rpm包是否還有
	rpm -qa |grep docker
5. 刪除docker鏡像放置的位置
	rm -rf /var/lib/docker


免責聲明!

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



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