在 Ubuntu 16.04 上安装Nidia-Docker

来源:互联网 发布:ps纸张纹理 知乎 编辑:程序博客网 时间:2024/06/13 00:14

在 Ubuntu 16.04 上安装Nidia-Docker

Docker CE 的安装

由于 Ubuntu 源里的docker版本太老,建议根据官方教程安装
这是2017年12月24日根据docker官方文档记录的,省略了一些步骤,仅供参考,如果安装失败,建议您查看官方文档

Set up the repository

1.Upadate apt package index:

$ sudo apt-get update

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

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

3.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 0EBFCD88pub   4096R/0EBFCD88 2017-02-22      Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88uid                  Docker Release (CE deb) <docker@docker.com>sub   4096R/F273FCD8 2017-02-22

4.Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below.

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

Install Docker CE

$ sudo apt-get install docker-ce

Verify that Docker CE is installed correctly by running the hello-world image

$ sudo docker run hello-world

执行这条命令后,如果本地没有这个 image ,会连接官方的 Docker Hub 进行下载,连接会花费一点时间,如果网络状况不好可以更改国内的镜像或使用加速器

Nvidia-Docker 的安装

GitHub:https://github.com/NVIDIA/nvidia-docker

Make sure you have installed the NVIDIA driver and a supported version of Docker for your distribution (see prerequisites).

If you have a custom /etc/docker/daemon.json, the nvidia-docker2 package might override it.

# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containersdocker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -fsudo apt-get purge -y nvidia-docker# Add the package repositoriescurl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \  sudo apt-key add -curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \  sudo tee /etc/apt/sources.list.d/nvidia-docker.listsudo apt-get update# Install nvidia-docker2 and reload the Docker daemon configurationsudo apt-get install -y nvidia-docker2sudo pkill -SIGHUP dockerd# Test nvidia-smi with the latest official CUDA imagedocker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 兰州交通大学 山东交通学院 香港400多组交通灯损坏 西南交通大学教务网 大连交通大学 交通安全综合服务管理平台 交通安全综合管理平台 交通警告标志 全国交通违章 交通安全知识 洛阳轨道交通 交通安全综合平台 河北交通违章 西安交通大学教务处 南京交通职业技术学院 重庆轨道交通环线 交通安全图片 西安交通大学研究生院 华东交通大学理工学院 交通标志大全及图解 大兴机场交通攻略 昆明轨道交通1号线 交通标志牌图解大全 道路交通标志标线 交通客服电话 贵阳轨道交通2号线 交通标志大全图解 上海交通大学研究生院 重庆轨道交通11号线 华东交通理工学院 交通信用卡进度查询 交通信用卡查询 交通综合服务平台 违章交通查询 交通事故无法认定责任 交通事故赔偿律师费用 交通事故责任无法认定 保险公司交通事故理赔 交通事故怎么报保险 交通事故伤残赔偿计算 道路交通事故伤残赔偿