centos 7 離線安裝docker
下載相關鏡像
https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
containerd.io-1.2.6-3.3.el7.x86_64.rpm
docker-ce-19.03.9-3.el7.x86_64.rpm
docker-ce-cli-19.03.9-3.el7.x86_64.rpm
卸載老版本的docker
sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
sudo rm -rf /var/lib/docker
安裝
yum install containerd.io-1.2.6-3.3.el7.x86_64.rpm
yum install docker-ce-cli-19.03.9-3.el7.x86_64.rpm
yum install docker-ce-19.03.9-3.el7.x86_64.rpm
啟動
sudo systemctl start docker
加入開機啟動
sudo systemctl enable docker
測試(需要連網下載)
sudo docker run hello-world
刪除docker
sudo yum remove docker-ce docker-ce-cli containerd.io
刪除docker相關鏡像
sudo rm -rf /var/lib/docker
