-------------------------------------------更新------------------------------------
sudo wget -O /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum -y install docker-ce
-------------------------------------------------------------------------------------
1.更换前准备
cd /etc/yum.repos.d/
mkdir backup
mv *.repo backup/
2.更换yum源
wget -O CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
3.更换epel源
wget -O epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
4.更新缓存
yum clean all
yum makecache
————————————————
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/xiaobei72aaa/article/details/131218255
安装一些插件
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
添加一下云源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
安装docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
授权docker-compose
sudo chmod 755 /usr/local/bin/docker-compose