Installation of Docker-ce and Nvidia-docker

Source: Internet
Author: User
Tags commit curl gpg centos docker ps pkill docker run aliyun

Prerequisites
Install docker ce

Using Docker recently is a lot more personal than a virtual machine. Install docker ce ubuntu,However, installing Docker under Linux and Windows will overwhelm a group of people that we don't want to see.
Docker ce install


Package docker ce has no installation candidate

This article describes in detail the installation of Docker-ce and Nvidia-docker under Ubuntu, and how to use the domestic image to speed up the download of the corresponding image. Similarly, the use of Windows is simply mentioned.


Docker ce has no installation candidate


Share a docker of popular science: https://yeasy.gitbooks.io/docker_practice/content/introduction/what.html

Install docker ce in ubuntu



The founder of Docker quit today ... Sad to install Docker under Windows


Install docker ce on ubuntu


Currently, Windows binary installation files support the minimum operating system for Windows 10. If you're using a previous version of Windows, you'll need to download the dockertoolbox[download address]. Because my Windows version is 10, so there is no installation, so the specific how to use toolbox how to install can refer to the following blog:





https://blog.csdn.net/tina_ttl/article/details/51372604
https://blog.csdn.net/chengly0129/article/details/68944762
https://my.oschina.net/liuyuanyuangogo/blog/608064





After the installation is complete, you can choose to use the command line to control Docker, or use kitematic (which can be installed separately) to handle Docker-related content using a graphical interface.





After installation, if the pull/submit mirror on the dock hub is too slow, consider registering an account with https://www.daocloud.io/and using the Docker accelerator to speed up the download/upload process.





Of course, the official instructions are more detailed, want to know the students can go to see the https://store.docker.com/editions/community/docker-ce-desktop-windows





To add: Nvidia-docker is not currently supported for installation on Windows, so developing small partners who want to use Cuda and Nvidia GPUs in Windows Docker, preferably on Linux, or directly using physical machines for development. installing Docker under Ubuntu





First put on the official address, https://docs.docker.com/install/linux/docker-ce/ubuntu/inside is very detailed.





However, according to their own experience, these things for domestic developers, just look beautiful.





I'm adding a gpg step Curl-fssl https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add-it will take a long time to wait.





After adding the source using the following command, the sudo apt update will not move directly behind ... The installation process is very dejected.



sudo add-apt-repository \
   "Deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $ (LSB_RELEASE-CS) \
   Stable "



Hey...... Let's get down to the chase. Because I have a common server on the hand, so this problem has to be resolved, the following to share my installation process. Add the Ali Docker image source





Reference https://yq.aliyun.com/articles/110806?commentId=11066





If you have previously installed an older version of Docker, you can uninstall it using the following command:



sudo apt-get remove Docker docker-engine Docker.io



Ubuntu 14.04 16.04 (install using apt-get)



# step 1: Install some of the necessary system Tools
sudo apt-get update
sudo apt-get-y install Apt-transport-https ca-certificates Curl Softwar E-properties-common
# step 2: Install GPG certificate
curl-fssl http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo Apt-key Add-
# Step 3: Write software source information
sudo add-apt-repository "Deb [ARCH=AMD64] http://mirrors.aliyun.com/docker-ce/ Linux/ubuntu $ (Lsb_release-cs) stable "
# Step 4: Update and install docker-ce
sudo apt-get-y update
sudo apt-get-y insta ll Docker-ce

# installs the specified version of Docker-ce:
# Step 1: Find the version of Docker-ce:
# Apt-cache Madison Docker-ce
#   Docker-ce | 17.03.1~ce-0~ubuntu-xenial | Http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
#   Docker-ce | 17.03.0~ce-0~ ubuntu-xenial | Http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
# Step 2: Install the specified version of Docker-ce: ( VERSION For example above 17.03.1~ce-0~ubuntu-xenial)
# sudo apt-get-y install docker-ce=[version]



Included: CentOS 7 (Install with Yum)



# step 1: Install some of the necessary system Tools sudo yum install-y yum-utils device-mapper-persistent-data lvm2 # step 2: Add software source information sudo yum-config-m Anager--add-repo Http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo # Step 3: Update and install Docker-ce sudo yum Makecache fast sudo yum-y install Docker-ce # Step 4: Open Docker services sudo service Docker start # Note: # The official software source is enabled by default with the latest software, which you can Edit the software source in a way that gets the various versions of the package. For example, the official does not have the test version of the software source to be available, you can open it by the following way.
In the same vein, various test versions can be opened. # Vim/etc/yum.repos.d/docker-ce.repo # Change the enabled=0 below [docker-ce-test] to enabled=1 # # Install the specified version of Docker-ce: # Step 1: Check Find Docker-ce version: # Yum list docker-ce.x86_64--showduplicates | SORT-R # Loading Mirror speeds from cached Hostfile # Loaded Plugins:branch, Fastestmirror, LangPacks # docker-ce. x86_64 17.03.1.ce-1.el7.centos docker-ce-stable # docker-ce.x86_64 17.03.1.ce-1.el7.cen TOS @docker-ce-stable # docker-ce.x86_64 17.03.0.ce-1.el7.centos docker-ce-stable # A vailable Packages # StEP2: Install the specified version of Docker-ce: (version for example 17.03.0.ce.1-1.el7.centos above) # sudo yum-y install docker-ce-[version] 


Installation verification



root@izbp12adskpuoxodbkqzjfz:$ Docker version
Client:
 version:      17.03.0-ce
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue 07:52:04 os/arch
 :      Linux/amd64

Server:
 version:      17.03.0-ce
 API version:  1.26 (minimum version 1.12)
 Go Version:   go1.7.5
 Git Commit:   3a232c8
 Built:        Tue Feb 07:52:04 os/arch
 :      linux/amd64
 Experimental:false



You can also use the Systemctl status Docker.service to view Docker running status. Installing Nvidia-docker





Reference Https://github.com/NVIDIA/nvidia-docker





This is just about Ubuntu, and the installation of other Linux variants can be found on GitHub.



# If you have Nvidia-docker 1.0 installed:we need-remove it and all existing 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

# ADD The package repositories
curl-s-L HTTPS://NV Idia.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

# Install Nvidia-docker2 and  Reload the Docker daemon configuration
sudo apt-get install-y nvidia-docker2
sudo pkill-sighup dockerd

# Test Nvidia-smi with the latest official CUDA image
Docker run--runtime=nvidia--rm Nvidia/cuda Nvidia-smi



The personal feeling of this statement, has been said very clearly. I also use this way to perform the installation, where the Pkill steps personally think can also be done, using the following command instead:



sudo systemctl daemon-reload
sudo systemctl restart Docker

use domestic source acceleration


The final step in installing Nvidia-docker is to test the Nvidia-smi in Nvidia-docker.





However, this step is too slow ... Then use the domestic source for a bit of acceleration.





https://www.daocloud.io/Accelerator can be used, but I do not know why, I did not succeed this time (under Windows is not a problem) ... Simply give up and find another way.





Then I found here Docker China Official image acceleration, the page has a very detailed introduction, here do not repeat.





Once found, you will start to download the image from the Nvidia/cuda repository, where the commands I use are:



Docker Pull Registry.docker-cn.com/nvidia/cuda



Download indeed very quickly, the whole process of about 5 minutes to complete, the image after decompression for 2.23G (before the size of the decompression is unclear). Summary





This is also my first time to install Docker-ce and Nvidia-docker, go a lot of detours. Many blogs are basically in accordance with the official website of the way, there is no mistake, but I did not walk through. So, provide another way for everyone to see, so that you can quickly experience the convenience of Docker.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.