Centos Docker 安装

作者: 划破的天空 | 来源:发表于2019-06-29 23:10 被阅读0次

    原文链接:https://www.fank243.com/posts/j5pz2ngx.html

    移除旧版本

    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
    

    安装依赖项

    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 makecache fast
    

    安装Docker-ce

    sudo yum -y install docker-ce
    

    启动Docker

    systemctl restart docker
    

    Docker 添加国内镜像

    sudo tee /etc/docker/daemon.json <<-'EOF'
    {
      "registry-mirrors": ["https://registry.docker-cn.com"]
    }
    EOF
    
    sudo systemctl daemon-reload
    sudo systemctl restart docker
    

    docker-compose 安装

    首先访问https://github.com/docker/compose/releases获取最新版本安装命令复制到shell下载安装即可

    curl -L https://github.com/docker/compose/releases/download/1.25.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
    chmod +x /usr/local/bin/docker-compose
    

    相关文章

      网友评论

        本文标题:Centos Docker 安装

        本文链接:https://www.haomeiwen.com/subject/iibmcctx.html