1、先下载docker的安装包
下载地址:https://download.docker.com/linux/static/stable/x86_64/
这里我们下载docker-19.03.9.tgz,然后上传到服务器上
解压tar -zxvf docker-19.03.9.tgz -C /usr/local
cp docker/* /usr/bin/
2、配置开机自启
vim /etc/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
赋执行权限
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
#开机启动
systemctl enable docker.service
启动docker
systemctl start docker
转自:docker离线安装 - testway - 博客园 (cnblogs.com)
标签:bin,service,com,离线,systemctl,docker,安装 From: https://www.cnblogs.com/Fengdengshuai/p/17085146.html