返回 首页

离线安装docker


本文参考 https://stackoverflow.com/a/53680524并稍作改动

1. 下载执行

wget https://download.docker.com/linux/static/edge/x86_64/docker-19.03.9.tgz
tar -zxvf docker-19.03.9.tgz
sudo cp docker/* /usr/bin/

使用systemd

新建/lib/systemd/system/dockerd.service

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

[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

StartLimitBurst=3

StartLimitInterval=60s

LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

TasksMax=infinity

Delegate=yes

KillMode=process
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable dockerd
service dockerd restart 
service dockerd status

完成

docker ps

登录