离线部署docker

1.2. 安装Docker
(1) 上传docker-19.03.5.tar安装包到/app目录下

(2) 解压docker-19.03.5.tar到当前文件夹

tar -zxvf docker-19.03.5.tar

(3) 将docker目录下所有文件复制到/usr/bin目录下

cp docker/* /usr/bin/

(4) 配置docker的systemctl指令

将如下内容写入到/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 --graph=/app/data/docker --storage-driver=overlay2 -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

(5) 添加执行权限:chmod +x /etc/systemd/system/docker.service
(6) 查看运行状态:systemctl status docker
(7) 重载unit配置文件:systemctl daemon-reload
(8) 启动Docker:systemctl start docker
(9) 设置开机自启:systemctl enable docker.service
(10) 查看docker运行状态:systemctl status docker

(11) 查看docker版本:docker -v

你可能感兴趣的:(docker,容器,运维)