System Requirements
Docker supports the following versions of the Ubuntu operating system:
- Ubuntu xenial 16.04 (LTS)
- Ubuntu Wily 15.10
- Ubuntu trusty 14.04 (LTS) This is my one.
- Ubuntu precise 12.04 (LTS)
Pre-installation
Docker is currently only installed on 64-bit platforms, and requires a kernel version of not less than 3.10, in fact, the newer the better, the low kernel version is prone to function instability.
Users can check their kernel version details by following the command below.
-aLinux Host 3.16.0-43-generic #58~14.04.1-Ubuntu SMP Mon Jun 22 10:21:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Or
#58~14.04.1-Ubuntu SMP Mon Jun 22 10:21:20 UTC 2015
The minimum version of Ubuntu currently supported by Docker is 12.04 LTS, but in practice it is recommended to use at least the 14.04 LTS version for stability reasons.
Update apt Image source
You first need to install the APT-TRANSPORT-HTTPS package to support the source of the HTTPS protocol.
$ sudo apt-get install apt-transport-https ca-certificates
Add a GPG key for the source.
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
Gets the code name of the current operating system.
$ lsb_release -cCodename: trusty
In general, the 12.04 (LTS) codenamed Precise,14.04 (LTS) codenamed TRUSTY,15.04 codenamed Vivid,15.10 codenamed Wily,16.04 is the code name for the order. This gets the code name for trusty.
Next you can add Docker's official apt software source. Create /etc/apt/sources.list.d/docker.list
a file with the following command and write the address contents of the source. Non-trusty version of the system attention to change to their corresponding code.
$ sudo cat <<EOF > /etc/apt/sources.list.d/docker.listdeb https://apt.dockerproject.org/repo ubuntu-trusty mainEOF
After the add succeeds, update the APT package cache.
$ sudo apt-get update
Sub-version Pre-installation task is higher than 12.04 LTS version
-
- Ubuntu xenial 16.04 (LTS)
- Ubuntu Wily 15.10
- Ubuntu trusty 14.04 (LTS)
- In order for Docker to use AUFS storage, it is recommended to install
linux-image-extra
packages.$ sudo apt-get install -y linux-image-extra-$(uname -r)
- Installing Docker on Ubuntu 14.04 or 12.04 requires installation
apparmor
(AppArmor is a security module for the Linux kernel, and the new version of Ubuntu has been integrated into the kernel):$ sudo apt-get install apparmor
12.04 LTS Version
If using the 12.04 LTS version, first update the system kernel and install the packages that may be required, including
- Linux-image-generic-lts-trusty (required)
- Linux-headers-generic-lts-trusty (required)
- Xserver-xorg-lts-trusty (required with graphical interface)
- Libgl1-mesa-glx-lts-trusty (required with graphical interface)
Install the command (depending on the environment and requirements, choose to install the above package), such as:
$ sudo apt-get install linux-image-generic-lts-trusty
Of course, 12.04 LTS also needs to be installed linux-image-extra
and packaged as needed apparmor
.
Note: In the Ubuntu release, LTS (long-term-support) means more stable functionality and longer-term (currently 5-year) upgrade support, using the LTS version as much as possible in the production environment.
Installing Docker
After the source has been successfully added, you can install the latest version of Docker and the package name is Docker-engine.
$ sudo apt-get install -y docker-engine
If there is an older version of Docker (Lxc-docker) in the system, you will be prompted to delete it first, select Yes.
Other optional configurations
See the Docker official configuration documentation.
"Reprint" Ubuntu series installation Docker