码迷,mamicode.com
首页 > 其他好文 > 详细

Centos7 安装 Docker CE

时间:2018-09-29 16:47:29      阅读:199      评论:0      收藏:0      [点我收藏+]

标签:make   linu   xxxxx   emc   mirror   http   mirrors   man   https   

安装

  1. 先安装 gcc

    sudo yum -y install gcc

  2. 如果有安装过 docker ,需要执行以下命令移除安装

    sudo 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. 添加镜像仓库(这里使用的是阿里的镜像仓库)

    sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

  4. 更新 yum 软件包索引

    sudo yum makecache fast

  5. 安装 docker-ce

    sudo yum -y install docker-ce

  6. 启动docker

    systemctl start docker

  7. 配置镜像加速

    sudo mkdir -p /etc/docker
    sudo tee /etc/docker/daemon.json <<-‘EOF‘
    {
    "registry-mirrors": ["https://xxxxx.mirror.aliyuncs.com"]
    }
    EOF
    sudo systemctl daemon-reload
    sudo systemctl restart docker

  8. docker hello-world

    docker run hello-world

Centos7 安装 Docker CE

标签:make   linu   xxxxx   emc   mirror   http   mirrors   man   https   

原文地址:https://www.cnblogs.com/Godfunc/p/9724239.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!