Centos7离线安装Docker

下载离线安装包

https://download.docker.com/linux/static/stable/x86_64/


安装

# 0.1> 解压
tar xzvf docker-20.10.3.tgz

# 0.2> 进入docker目录,将目录下的所有文件拷贝至“/usr/bin/”
cd docker/
cp * /usr/bin/

# 0.3> 配置docker服务
# 编辑文件
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


# 0.4> 增加可执行权限
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload 

# 5.0> 开机启动
systemctl enable docker.service

# 6.0> 启动Docker
systemctl start docker

# 7.0> 测试
docker -v
举报

© 著作权归作者所有


0