一、Linux 离线安装docker
1. 下载Linux版本离线安装包
- 下载地址
https://download.docker.com/linux/static/stable/x86_64/
- 下载的最新版本
docker-24.0.7.tgz
2. 安装docker
- 上传安装包
创建文件夹 dockersoftware
#mkdir dockersoftware
上传docker-24.0.7.tgz到 /dockersoftware
解压
#tar xvf docker-24.0.7.tgz
# ls -l docker
#cp docker/* /usr/bin
# rm -rf docker docker-24.0.7.tgz
- 配置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
- 赋执行权限
chmod +x
/etc/systemd/system/docker.service
systemctl daemon-reload
3. docker 命令
# 开机启动
systemctl enable docker.service
# 启动docker
systemctl start docker
# docker状态
systemctl status docker
# 重启docker服务
systemctl restart docker
#验证安装
标签:service,tgz,离线,24.0,systemctl,Linux,docker From: https://www.cnblogs.com/fxrz/p/17836482.html