Installation of the Docker CE under Ubuntu 16.04

Source: Internet
Author: User
Tags gpg docker hub docker run

Uninstall version of Docker
sudo apt-get remove docker docker-engine docker.io
Installing an optional kernel module

Starting with Ubuntu 14.04, a subset of kernel modules have been moved to the optional kernel module package (linux-image-extra-*) to
Reduce the size of the kernel package. A properly installed system should include an optional kernel module package, and some cropped systems
Might be able to streamline it. The AUFS kernel driver is part of the optional kernel module as a recommended Docker storage tier
Drivers, it is generally recommended to install the optional kernel module package to use AUFS. If not installed, you can use the following command to install

sudo apt-get updatesudo apt-get install  linux-image-extra-$(uname -r)  linux-image-extra-virtual
Installing the Docker CE

Because the apt source uses HTTPS to ensure that the software is not tampered with during the download. Therefore, we first need to add the use
HTTPS Transport packages and CA certificates.

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

In view of domestic network problems, it is strongly recommended to use domestic sources, the official source please check in the comments. To verify the legality of the downloaded package, you need to add a GPG key for the software source

curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -# 官方源#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Then we need to add the Docker software source to the Source.list

sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"# 官方源#  sudo add-apt-repository # "deb [arch=amd64] https://download.docker.com/linux/ubuntu # $(lsb_release -cs) # stable

Update APT package cache and install Docker-ce

sudo apt-get updatesudo apt-get install docker-ce
Start Docker CE
sudo systemctl enable dockersudo systemctl start docker
Test whether the installation is correct
sudo docker run hello-worldunable to find image ' Hello-world:latest ' locallylatest:pulling from Library/hello-worldca4f6 1b1923c:pull Complete Digest:sha256:445b2fe9afea8b4aa0b2f27fe49dd6ad130dfe7a8fd0832be5de99625dad47cdstatus: Downloaded newer image for Hello-world:latesthello from docker! This message shows the your installation appears to be working correctly. To generate this message, Docker took the following steps:1. The Docker client contacted the Docker daemon.    2. The Docker daemon pulled the "Hello-world" image from the Docker Hub. (AMD64)  3. The Docker daemon created a new container from this image which runs the executable that produces the output is Currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something + ambitious, you can run an Ubuntu container with: $ docker run-it ubuntu Bashshare images, automate Workflows, and more with a free Docker id:https://cloud.docker.com/for moreExamples and ideas, visit:https://docs.docker.com/engine/userguide/ 

If the above information appears, the installation is successful

Mirroring acceleration

Because of the foreign mirror sometimes the network access is too slow, need to use the domestic image acceleration

For systems that use SYSTEMD, write the following in the/etc/docker/daemon.json (if the file does not exist
In the please create this file)

{"registry-mirrors": [    "https://registry.docker-cn.com"    ]}

Restart the system after reboot

sudo systemctl daemon-reloadsudo systemctl restart docker

Installation of the Docker CE under Ubuntu 16.04

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.