美文网首页
linux下docker-ce的安装步骤

linux下docker-ce的安装步骤

作者: JohnYuCN | 来源:发表于2020-05-04 20:43 被阅读0次

    1. 官网方式(不推荐)

    apt-get update
    
    apt-get install -y \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg-agent \
        software-properties-common
    
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
    add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"
    
    apt-get update
    
    apt-get install -y docker-ce docker-ce-cli containerd.io
    
    docker info
    

    2. 使用阿里源的安装

    apt-get update
    
    apt-get install -y \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg-agent \
        software-properties-common
    
    curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
    
    sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
    
    apt-get update
    
    apt-get install -y docker-ce docker-ce-cli containerd.io
    
    docker info
    

    3. 使用阿里的镜像加速服务:

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

    相关文章

      网友评论

          本文标题:linux下docker-ce的安装步骤

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