美文网首页
Mint 仓库安装Docker(官方原版)

Mint 仓库安装Docker(官方原版)

作者: NIGangJun | 来源:发表于2019-11-19 16:05 被阅读0次

    2019-12月更新 Mint 19.2 Tina 无法正常添加仓库
    注:由于工作急需Docker环境,为了方便就没有继续折腾,换了其他版本


    以下内容基于 Mint 19.1 Tessa 版本

    • 卸载旧版
    $ sudo apt-get remove docker docker-engine docker.io containerd runc
    

    使用仓库安装

    • 更新apt包
    $ sudo apt-get update
    
    • 安装一些依赖和工具包
    $ sudo apt-get install \
        apt-transport-https \
        ca-certificates \
        curl \
        gnupg-agent \
        software-properties-common
    
    • 添加官方的GPG密钥
    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    

    这里验证一下fingerprint,讲道理是可以跳过验证的,不放心的验证一下也无伤大雅

    $ sudo apt-key fingerprint 0EBFCD88
    # 输出以下三行就是添加上了
    pub   rsa4096 2017-02-22 [SCEA]
          9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
    uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
    sub   rsa4096 2017-02-22 [S]
    
    • 添加仓库(重点来了)

    先引用一个官方的说明

    Note: The lsb_release -cs sub-command below returns the name of your Ubuntu distribution, such as xenial. Sometimes, in a distribution like Linux Mint, you might need to change $(lsb_release -cs) to your parent Ubuntu distribution. For example, if you are using Linux Mint Tessa, you could use bionic. Docker does not offer any guarantees on untested and unsupported Ubuntu distributions.

    上面说lsb_release -cs会返回Ubuntu distribution(发行版)的名称,但是像Linux Mint需要改一下这个。如果使用的Mint的发行版为Tessa(可以在终端输入lsb_release -cs查看),那么可以改成bionic。Docker对没有测试和不受支持的发行版不提供任何说明。

    # 官方提供了多种架构只需要在[arch=]后面修改(armhf、arm64、ppc64el、s390x)
    # 下面是 x86_64 / amd64 的
    $ sudo add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       bionic \
       stable"
    
    • 更新资源
    $ sudo apt-get update
    
    • 安装Docker最新版本(其他版本可以自行阅览官方教程)
    $ sudo apt-get install docker-ce docker-ce-cli containerd.io
    

    相关文章

      网友评论

          本文标题:Mint 仓库安装Docker(官方原版)

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