centos docker离线安装
时间: 2023-11-23 07:08:25 浏览: 164
docker离线安装全部依赖
以下是CentOS离线安装Docker的步骤:
1.从Docker官方网站下载Docker安装包,下载地址为:https://download.docker.com/linux/static/stable/x86_64/
2.解压下载的Docker安装包
3.将解压出来的docker文件复制到/usr/bin/目录下
4.进入/etc/systemd/system/目录,并创建docker.service文件,内容如下,这样可以将docker注册为service服务:
```
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
[Service]
Type=notify
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
LimitNPROC=1048576
LimitCORE=infinity
TimeoutStartSec=0
Restart=on-abnormal
[Install]
WantedBy=multi-user.target
```
5.启动Docker
6.检查Docker环境
```shell
systemctl start docker
systemctl enable docker
docker version
```
阅读全文