unbuntu 安装docker、nvidia-docker2

添加源https://download.docker.com/

Uninstall old versions

sudo apt-get remove docker docker-engine docker.io containerd runc

Install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg2 \
    software-properties-common

Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

$ sudo apt-key fingerprint 0EBFCD88

pub   4096R/0EBFCD88 2017-02-22
      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) <docker@docker.com>
sub   4096R/F273FCD8 2017-02-22

Use the following command to set up the stable repository.

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Update the apt package index.

这里我出现update失败, 有 Ign 出现,需要修改DNS
/etc/resolv.conf,最下面就多了3行:

修改 /etc/resolv.conf

nameserver 8.8.8.8 
nameserver 8.8.4.4 
nameserver 114.114.114.114

参考文章:https://blog.csdn.net/u012255731/article/details/53167779

安装docker-ce

sudo apt install docker-ce=5:18.09.1~3-0~ubuntu-xenial

安装nvidia-docker2

参考https://blog.csdn.net/chxw098/article/details/79741586
Docker version (>= 19.03) no need nvidia-docker2, use nvidia-container-toolkit
参考docker website

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值