Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Docker and nvidia-docker in Ubuntu16.04

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to install Docker and nvidia-docker in Ubuntu16.04. I hope you will get something after reading this article. Let's discuss it together.

Docker installation

1. Replace the domestic software source, recommend the source of University of Science and Technology of China, stable and fast (optional)

Sudo cp / etc/apt/sources.list / etc/apt/sources.list.baksudo sed-I'Accorde archive.ubuntu.com Universe mirrors.ustc.edu.cnUniverse g' / etc/apt/sources.listsudo apt update

two。 Install the required packages

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

3. Add GPG key and add Docker-ce software source. Here, take the Docker-ce source of 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 a successful addition

Sudo apt update

5. Install Docker-ce

Sudo apt install docker-ce

6. Set boot self-boot and start Docker-ce (default is set and started after successful installation, but can be ignored)

Sudo systemctl enable dockersudo systemctl start docker

7. Test run

Sudo docker run hello-world

8. Add the current user to the docker user group and run docker without sudo (optional)

Sudo groupadd dockersudo usermod-aG docker $USER

9. Test add user groups (optional)

Docker run hello-world

Nvidia-docker installation

1. Uninstall nvidia-docker 1.0and 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-fsudo apt-get purge-y nvidia-docker

two。 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.listsudo apt-get update

3. Install nvidia-docker2

Sudo apt-get install-y nvidia-docker2sudo pkill-SIGHUP dockerd

4. Test installation

Docker run-runtime=nvidia-rm nvidia/cuda:9.0-base nvidia-smiReferences after reading this article, I believe you have some understanding of "how to install Docker and nvidia-docker in Ubuntu16.04". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report