一垄分,準(zhǔn)備篇
1搓译,配置網(wǎng)絡(luò)&關(guān)閉SELINUX&配置防火墻
配置網(wǎng)絡(luò)&關(guān)閉SELINUX&配置防火墻
二,安裝篇
1锋喜,卸載舊版本
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2,設(shè)置穩(wěn)定版yum repository
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
3豌鸡,安裝docker
yum install docker-ce docker-ce-cli containerd.io
如果提示您接受GPG密鑰嘿般,請驗(yàn)證指紋是否匹配 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35,如果是涯冠,則接受它炉奴。
4,啟動(dòng)docker
systemctl start docker
systemctl enable docker
systemctl disable docker
systemctl restart docker
5蛇更,docker鏡像加速
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}
systemctl daemon-reload
systemctl restart docker
6瞻赶,卸載docker
#卸載docker軟件包
yum remove docker-ce
#刪除 映像,容器派任,卷或自定義配置文件
rm -rf /var/lib/docker
7砸逊,安裝docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version