docker安装
https://www.runoob.com/docker/centos-docker-install.html
https://www.cnblogs.com/caoweixiong/p/12186736.html
https://www.cnblogs.com/fatt/p/10302121.html
首先设置base和eppo源
下载阿里云的Base源和EPEL源
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sudo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
-
CentOS7能上外网
-
yum -y install gcc
-
yum -y install gcc-c++
然后卸载旧版本:
$ sudo yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
可以选择国内的一些源地址:
阿里云
$ sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装最新版本的 Docker Engine-Community 和 containerd,或者转到下一步安装特定版本:
$ sudo yum install docker-ce docker-ce-cli containerd.io