sudo yum********** --resolve --destdir=/tmp/docker docker-ce-
tar -zcvf docker.tar.gz /tmp/docker
scp -r docker.tar.gz deploy-host(部署的內網伺服器)
#建立system管理檔案 --graph=/var/lib/docker 為預設路勁想更改資料目錄可以替換
[root@zabbix docker]
# cat > /usr/lib/systemd/system/docker.service <
>
[unit]
> documentation=
>
[service]
> environment=
"path=/usr/bin:/bin:/sbin:/usr/bin:/usr/sbin"
> environmentfile=-/run/flannel/docker
> execstart=/usr/bin/dockerd --graph=/var/lib/docker --log-level=error $docker_network_options
> execreload=/bin/kill -s hup $mainpid
> restart=on-failure
> restartsec=5
> limitnofile=infinity
> limitnproc=infinity
> limitcore=infinity
> delegate=yes
> killmode=process
>
>
[install]
> wantedby=multi-user.target
> eof
#替換預設儲存資料目錄為/docker 不替換可以省略
sed -i s#/var/lib/docker#$/docker#g /usr/lib/systemd/system/docker.service
[root@zabbix docker]
# systemctl daemon-reload
[root@zabbix docker]
# systemctl restart docker
[root@zabbix docker]
# systemctl status docker
loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
active: active (running) since fri 2020-05-29 10:57:32 cst; 6s ago
docs:
main pid: 11890 (dockerd)
tasks: 23
memory: 9.5m
cgroup: /system.slice/docker.service
├─11890 /usr/bin/dockerd --graph=/var/lib/docker --log-level=error
├─11902 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
└─11961 /sbin/iptables --wait -t nat -d prerouting -m addrtype --dst-type local -j docker
^c[root@zabbix docker]
# docker ps
container id image command created status ports names
[root@zabbix docker]
#
只要我還能划水,我就不肯被淹死,只要我還能站立,我就不肯倒下。 docker離線安裝
安裝docker 1.複製local repo到本機 2.更改本地yum源為locol repo 建立 etc etc yum.repos.d local.repo 3.yum clean all yum makecache 4.yum install docker 5.啟動docker syste...
docker 離線安裝
連線 建議安裝高版本 檢視下版本號 cat etc redhat release docker ce selinux rpm ivh docker ce selinux 17.03.3.ce 1.el7.noarch.rpm rpm ivh docker ce 17.03.3.ce 1.el7.x8...
linux 離線安裝docker
注 作者核心版本 3.10.0 862.el7.x86 64 作者需要在離線環境中安裝docker 網上大部分方法都比較麻煩,無意中發現此方法簡便明了 yum install downloadonly downloaddir opt docker docker tar zcvf docker.tar...