美文网首页
centos docker安装

centos docker安装

作者: ArtisCoder | 来源:发表于2019-08-25 22:24 被阅读0次

    删除旧版本

    yum remove docker docker-client \
        docker-client-latest \  
        docker-common \ 
        docker-latest \
        docker-latest-logrotate \
        docker-logrotate \
        docker-engine
    

    安装依赖包

    yum install -y yum-utils device-mapper-persistent-data lvm2
    

    添加repo

    yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    

    安装

    yum install -y docker-ce docker-ce-cli containerd.io
    systemctl enable docker & systemctl start docker
    

    docker 镜像加速,申请阿里账号,获取专属加速通道

    mkdir -p /etc/docker
    cat <<EOF >/etc/docker/daemon.json
    {
      "registry-mirrors": ["https://xxxxxx.mirror.aliyuncs.com"],
      "exec-opts": ["native.cgroupdriver=systemd"]
    }
    EOF
    systemctl daemon-reload & systemctl restart docker
    

    相关文章

      网友评论

          本文标题:centos docker安装

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