Merge pull request #261 from mstanleyjones/167_clarify_apt_repo

Clarify how to verify the APT source
This commit is contained in:
Sebastiaan van Stijn 2016-10-18 18:03:16 -07:00 committed by GitHub
commit f40170a796
1 changed files with 64 additions and 45 deletions

View File

@ -20,12 +20,12 @@ Docker is supported on these Ubuntu operating systems:
- Ubuntu Precise 12.04 (LTS)
This page instructs you to install using Docker-managed release packages and
installation mechanisms. Using these packages ensures you get the latest release
of Docker. If you wish to install using Ubuntu-managed packages, consult your
Ubuntu documentation.
installation mechanisms. Using these packages ensures you get the latest official
release of Docker. If you are required to install using Ubuntu-managed packages,
consult the Ubuntu documentation.
>**Note**: Ubuntu Utopic 14.10 and 15.04 exist in Docker's `APT` repository but
> are no longer officially supported.
are no longer officially supported.
## Prerequisites
@ -34,7 +34,7 @@ Additionally, your kernel must be 3.10 at minimum. The latest 3.10 minor version
or a newer maintained version are also acceptable.
Kernels older than 3.10 lack some of the features required to run Docker
containers. These older versions are known to have bugs which cause data loss
containers. These older versions have known bugs which cause data loss
and frequently panic under certain conditions.
To check your current kernel version, open a terminal and use `uname -r` to
@ -49,7 +49,7 @@ your `APT` sources to the new Docker repository.
### Update your apt sources
Docker's `APT` repository contains Docker 1.7.1 and higher. To set `APT` to use
packages from the new repository:
packages from the Docker repository:
1. Log into your machine as a user with `sudo` or `root` privileges.
@ -57,55 +57,74 @@ packages from the new repository:
3. Update package information, ensure that APT works with the `https` method, and that CA certificates are installed.
```bash
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates
```
4. Add the new `GPG` key.
```bash
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
```
5. Open the `/etc/apt/sources.list.d/docker.list` file in your favorite editor.
5. Find the entry for your Ubuntu operating system.
If the file doesn't exist, create it.
The entry determines where APT will search for packages. The possible entries
are:
6. Remove any existing entries.
| Ubuntu version | Repository |
| ------------------- | ----------------------------------------------------------- |
| Precise 12.04 (LTS) | `deb https://apt.dockerproject.org/repo ubuntu-precise main`|
| Trusty 14.04 (LTS) | `deb https://apt.dockerproject.org/repo ubuntu-trusty main` |
| Xenial 16.04 (LTS) | `deb https://apt.dockerproject.org/repo ubuntu-xenial main` |
7. Add an entry for your Ubuntu operating system.
The possible entries are:
>**Note**: Docker does not provide packages for all architectures. Binary artifacts
are built nightly, and you can download them from
https://master.dockerproject.org. To install docker on a multi-architecture
system, add an `[arch=...]` clause to the entry. Refer to
[Debian Multiarch wiki](https://wiki.debian.org/Multiarch/HOWTO#Setting_up_apt_sources)
for details.
- On Ubuntu Precise 12.04 (LTS)
6. Run the following command, substituting the entry for your operating system
for the placeholder `<REPO>`.
deb https://apt.dockerproject.org/repo ubuntu-precise main
```bash
$ sudo echo "<REPO>" > /etc/apt/sources.list.d/docker.list
```
- On Ubuntu Trusty 14.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-trusty main
- Ubuntu Xenial 16.04 (LTS)
deb https://apt.dockerproject.org/repo ubuntu-xenial main
> **Note**: Docker does not provide packages for all architectures. You can find
> nightly built binaries in https://master.dockerproject.org. To install docker on
> a multi-architecture system, add an `[arch=...]` clause to the entry. Refer to the
> [Debian Multiarch wiki](https://wiki.debian.org/Multiarch/HOWTO#Setting_up_apt_sources)
> for details.
8. Save and close the `/etc/apt/sources.list.d/docker.list` file.
9. Update the `APT` package index.
7. Update the `APT` package index.
```bash
$ sudo apt-get update
```
10. Purge the old repo if it exists.
8. Verify that `APT` is pulling from the right repository.
$ sudo apt-get purge lxc-docker
11. Verify that `APT` is pulling from the right repository.
When you run the following command, an entry is returned for each version of
Docker that is available for you to install. Each entry should have the URL
`https://apt.dockerproject.org/repo/`. The version currently installed is
marked with `***`.The output below is truncated.
```bash
$ apt-cache policy docker-engine
docker-engine:
Installed: 1.12.2-0~trusty
Candidate: 1.12.2-0~trusty
Version table:
*** 1.12.2-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
100 /var/lib/dpkg/status
1.12.1-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
1.12.0-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
1.11.2-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
1.11.1-0~trusty 0
500 https://apt.dockerproject.org/repo/ ubuntu-trusty/main amd64 Packages
```
From now on when you run `apt-get upgrade`, `APT` pulls from the new repository.
### Prerequisites by Ubuntu Version