Detailed tutorial on installing Docker and nvidia-docker on Ubuntu 16.04

Detailed tutorial on installing Docker and nvidia-docker on Ubuntu 16.04

Docker Installation

1. Replace the domestic software source. The source from the University of Science and Technology of China is recommended. It is stable and fast (optional)

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo apt update

2. Install required packages

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

3. Add the GPG key and add the Docker-ce software source. Here we take the Docker-ce source of the University of Science and Technology of China as an example.

curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) stable"

4. Update the package cache after adding successfully

sudo apt update

5. Install Docker-ce

sudo apt install docker-ce

6. Set the boot-up auto-start and start Docker-ce (it has been set and started by default after successful installation, which can be ignored)

sudo systemctl enable docker
sudo systemctl start docker

7. Test run

sudo docker run hello-world

8. Add the current user to the docker user group so that you can run docker without sudo (optional)

sudo groupadd docker
sudo usermod -aG docker $USER

9. Test adding user groups (optional)

docker run hello-world

Nvidia-docker installation

1. Uninstall nvidia-docker 1.0 and other GPU containers

docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker

2. Add package repositories

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
 sudo apt-key add -
distribution=$(./etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
 sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

3. Install nvidia-docker2

sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

4. Test the installation

docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
References

https://docs.docker.com/install/

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

Summarize

The above is the tutorial on how to install Docker and nvidia-docker on Ubuntu 16.04. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to install RTX2080 Nvidia graphics card driver in Ubuntu18.04.2
  • Install nvidia graphics driver under Ubuntu (simple installation method)
  • Tutorial on installing Ubuntu 20.04 and NVIDIA drivers
  • Detailed tutorial on installing nvidia driver + CUDA + cuDNN in Ubuntu 16.04
  • Install Nvidia driver in Ubuntu 18 to solve black screen and adjust resolution problem
  • Tutorial on installing Nvidia graphics card driver in Ubuntu 18.04 (with pictures and text)

<<:  In-depth explanation of MySQL common index and unique index

>>:  Steps to build the vite+vue3+element-plus project

Recommend

A brief discussion on the role of HTML empty links

Empty link: That is, there is no link with a targ...

Detailed explanation of JQuery selector

Table of contents Basic selectors: Level selector...

Solve the Linux Tensorflow2.0 installation problem

conda update conda pip install tf-nightly-gpu-2.0...

Search engine free collection of website entrances

1: Baidu website login entrance Website: http://ww...

How to clear floating example code in css

Overview The framework diagram of this article is...

Detailed process of building mysql5.7.29 on centos7 of linux

1. Download MySQL 1.1 Download address https://do...

Detailed explanation of JavaScript Reduce

Table of contents map filter some every findIndex...

Mini Program to Implement Slider Effect

This article example shares the specific code for...

A complete list of common Linux system commands for beginners

Learning Linux commands is the biggest obstacle f...

How to configure MySQL8 in Nacos

1. Create the MySQL database nacos_config 2. Sele...

Website design should pay attention to the sense of color hierarchy

Recently I have been saying that design needs to h...

Solution to ES memory overflow when starting docker

Add the jvm.options file to the elasticsearch con...

Share CSS writing standards and order [recommended for everyone to use]

CSS writing order 1. Position attributes (positio...

Vue uses the Element el-upload component to step on the pit

Table of contents 1. Basic Use 2. Image quantity ...