美文网首页Docker
使用国内源为Ubuntu18.04安装Docker

使用国内源为Ubuntu18.04安装Docker

作者: Rakutens | 来源:发表于2019-04-02 13:57 被阅读0次

    (使用中科大镜像源,同时支持PC与ARM设备)

    1.添加源文件/etc/apt/sources.list.d/ustc.list

    (也可以直接修改原来的/etc/apt/sources.list)

    deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
    deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
    deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-proposed main multiverse restricted universe
    deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
    deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
    #deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
    #deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
    #deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-proposed main multiverse restricted universe
    #deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
    #deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
    
    2.安装必要工具
    sudo apt-get update\
    sudo apt-get -y install \
        apt-transport-https \
        ca-certificates \
        curl \
        software-properties-common
    
    3.添加软件源的 GPG 密钥
    curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
    
    4.向 source.list 中添加 Docker 软件源
    sudo add-apt-repository \
        "deb https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
        $(lsb_release -cs) \
        stable"
    
    5.更新缓存并安装docker
    sudo apt-get update
    sudo apt-get -y install docker-ce
    
    6.创建用户组并添加当前用户
    sudo groupadd docker
    sudo usermod -aG docker $USER
    

    相关文章

      网友评论

        本文标题:使用国内源为Ubuntu18.04安装Docker

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