Centos 7 安装 Docker-ce 18.09版本

1.安装GCC
yum -y install gcc
yum -y install gcc-c++

2. 卸载老版本的Docker和其他相关依赖
yum  remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

3.安装 yum-utils 等组件
yum install -y yum-utils device-mapper-persistent-data lvm2

4.添加yum 源 PS:
    4.1 docker官网地址: sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    4.2 阿里云地址:sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

5.更新 yum 索引
sudo yum makecache fast

6.安装  docker-ce
sudo yum install docker-ce

7.启动 docker
sudo systemctl start docker

8.验证是否安装成功
sudo docker info

9.配置镜像加速器
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://mwr4gsvc.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

你可能感兴趣的:(Docker)