Ubuntu
Ubuntu 14.04 and later
The Ubuntu14.04 version of the official software source has its own Docker package, which can be installed directly:
$ sudo apt-get update
$ sudo apt-get install-y Docker.io
$ sudo ln-sf/usr/bin/docker.io/usr/local/bin/docker
$ sudo sed-i ' $acomplete-F _docker Docker '/etc/bash_completion.d/docker.io
The above process uses the Ubuntu14.04 system to install Docker by default with the Docker.io installation package, so that the installed Docker version is relatively old.
Readers can also install the latest version from the official Docker source in the following ways. First you need to install Apt-transport-https and add the Docker official source:
$ sudo apt-get install Apt-transport-https $ sudo apt-key adv--keyserver hkp://keyserver.ubuntu.com:80--recv-keys 36A1D7 869245c8950f966e92d8576a8ba88d21e9
$ sudo bash-c "echo deb Https://get.docker.io/ubuntu Docker main >/etc/apt/sources.list.d/docker.list& quot
$ sudo apt-get update
Later, you can install the latest version of Docker with the following command:
$ sudo apt-get install-y lxc-docker
After installing the official Docker software source, if you need to update the Docker software version, simply execute the following command to upgrade:
$ sudo apt-get update-y lxc-docker
When using $ as the Terminal guide in the following article, it represents a non-root user; #代表是root用户.
Versions under Ubuntu 14.04
If you are using an older Ubuntu system, you will need to do the kernel update and reboot the system before installing:
$ sudo apt-get update $ sudo apt-get install-y linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ sudo reboot
After restarting, repeat the installation steps on the Ubuntu 14.04 system.
Centos
Docker supports CentOS 6 and later versions.
For CentOS 6 systems, you can install Docker using the Epel Library command as follows:
$ sudo yum install-y http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm $ sudo yum install-y Docker-io
For CentOS7 systems, because Docker is built into the Centos-extras source, readers can install it directly using the Yum command:
$ sudo yum install-y Docker
There are two ways to update the Docker software in the CentOS system, one is to compile the installation through the source code, and the other is to download the binary files for updating.
This article is from the Fresh Air Team blog, so be sure to keep this source http://freshair.blog.51cto.com/8272891/1958343
1 Ubuntu Installation Docker