離線安裝docker版本
阿新 • • 發佈:2018-12-12
準備,下載docker檔案
原教程:
作者:咖啡那麼濃
來源:CSDN
原文:https://blog.csdn.net/ywd1992/article/details/82897394
Docker版本:18.06.1 官方下載地址(打不開可能需要科學上網)
百度雲Docker 18.06.1地址:https://pan.baidu.com/s/1YdN9z72QutPkHBfLq06H1A 密碼:dvvh
方參考文件:https://docs.docker.com/install/linux/docker-ce/binaries/#install-static-binaries
docker解壓
tar -xvf docker-18.06.1-ce.tgzs
將解壓出來的docker檔案內容移動到 /usr/bin/ 目錄下
cp docker/* /usr/bin/
將docker註冊為service
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 # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity # Uncomment TasksMax if your systemd version supports it. # Only systemd 226 and above support this version. #TasksMax=infinity TimeoutStartSec=0 # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes # kill only the docker process, not all processes in the cgroup KillMode=process # restart the docker process if it exits prematurely Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target
新增檔案許可權並啟動docker
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload
systemctl start docker #啟動Docker
## systemctl enable docker.service #設定開機自啟
驗證
systemctl status docker #檢視Docker狀態
docker -v #檢視Docker版本