Centos7.2安裝Docker

官網地址:https://www.docker.com/

卸載舊版本Docker

卸載插件

docker plugin rm

刪除plugins.json

從 /var/lib/docker/plugins/ 中刪除 plugins.json

卸載安裝包

yum remove docker*

卸載組件

yum remove  container-selinux-1.12.5-14.el7.centos.x86_64

安裝Docker

安裝utils

yum install -y yum-utils

下載yum源

yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

更新軟件緩存

yum makecache fast

獲取、安裝Docker CE

yum -y install docker-ce
yum install -y docker-ce-18.03.1.ce //3.10 內核

啓動Docker,查看版本

systemctl start docker
docker info

設置開機啓動

systemctl enable docker

配置加速器

可以申請阿里雲加速器、DaoCloud 加速器、靈雀雲加速器,申請之後,會獲取如https://jxus37ad.mirror.aliyuncs.com 這樣的地址。然後將其配置到Docker引擎。

curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://f6c89410.m.daocloud.io

修改配置文件

find / -name docker.service -type f

找到 ExecStart= 這一行,在這行最後添加加速器地址 --registry-mirror=<加速器地址> ,如:ExecStart=/usr/bin/dockerd--registry-mirror=https://jxus37ad.mirror.aliyuncs.com

重新加載配置

systemctl daemon-reload

重新啓動

systemctl restart docker

加速器

https://www.cnblogs.com/sxdcgaq8080/p/9198748.html
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章