Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions install/linux/docker-ce/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ Older versions of Docker were called `docker`, `docker.io `, or `docker-engine`.
If these are installed, uninstall them:

```bash
$ sudo apt-get remove docker docker-engine docker.io containerd runc
$ sudo apt remove docker docker-engine docker.io containerd runc
```

It's OK if `apt-get` reports that none of these packages are installed.
It's OK if `apt` reports that none of these packages are installed.

The contents of `/var/lib/docker/`, including images, containers, volumes, and
networks, are preserved. The Docker CE package is now called `docker-ce`.
Expand Down Expand Up @@ -94,13 +94,13 @@ from the repository.
1. Update the `apt` package index:

```bash
$ sudo apt-get update
$ sudo apt update
```

2. Install packages to allow `apt` to use a repository over HTTPS:

```bash
$ sudo apt-get install \
$ sudo apt install \
apt-transport-https \
ca-certificates \
curl \
Expand Down Expand Up @@ -204,41 +204,46 @@ from the repository.
1. Update the `apt` package index.

```bash
$ sudo apt-get update
$ sudo apt update
```

2. Install the _latest version_ of Docker CE and containerd, or go to the next step to install a specific version:

```bash
$ sudo apt-get install docker-ce docker-ce-cli containerd.io
$ sudo apt install docker-ce docker-ce-cli containerd.io
```

> Got multiple Docker repositories?
>
> If you have multiple Docker repositories enabled, installing
> or updating without specifying a version in the `apt-get install` or
> `apt-get update` command always installs the highest possible version,
> or updating without specifying a version in the `apt install` or
> `apt update` command always installs the highest possible version,
> which may not be appropriate for your stability needs.

3. To install a _specific version_ of Docker CE, list the available versions in the repo, then select and install:

a. List the versions available in your repo:

```bash
$ apt-cache madison docker-ce

docker-ce | 5:18.09.1~3-0~ubuntu-xenial | {{ download-url-base }} xenial/stable amd64 Packages
docker-ce | 5:18.09.0~3-0~ubuntu-xenial | {{ download-url-base }} xenial/stable amd64 Packages
docker-ce | 18.06.1~ce~3-0~ubuntu | {{ download-url-base }} xenial/stable amd64 Packages
docker-ce | 18.06.0~ce~3-0~ubuntu | {{ download-url-base }} xenial/stable amd64 Packages
$ apt policy docker-ce
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should use apt list -a docker-ce instead;

apt list -a docker-ce
Listing... Done
docker-ce/bionic,now 5:18.09.1~3-0~ubuntu-bionic amd64 [installed]
docker-ce/bionic 5:18.09.0~3-0~ubuntu-bionic amd64
docker-ce/bionic 18.06.1~ce~3-0~ubuntu amd64
docker-ce/bionic 18.06.0~ce~3-0~ubuntu amd64
docker-ce/bionic 18.05.0~ce~3-0~ubuntu amd64
docker-ce/bionic 18.03.1~ce~3-0~ubuntu amd64


docker-ce:
Installed: 5:18.09.1~3-0~ubuntu-bionic
Candidate: 5:18.09.1~3-0~ubuntu-bionic
Version table:
*** 5:18.09.1~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
100 /var/lib/dpkg/status
5:18.09.0~3-0~ubuntu-bionic 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
...
```

b. Install a specific version using the version string from the second column,
for example, `5:18.09.1~3-0~ubuntu-xenial`.
for example, `5:18.09.1~3-0~ubuntu-bionic`.

```bash
$ sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io
$ sudo apt install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io
```

4. Verify that Docker CE is installed correctly by running the `hello-world`
Expand All @@ -259,7 +264,7 @@ steps.

#### Upgrade Docker CE

To upgrade Docker CE, first run `sudo apt-get update`, then follow the
To upgrade Docker CE, first run `sudo apt update`, then follow the
[installation instructions](#install-docker-ce), choosing the new version you want
to install.

Expand Down Expand Up @@ -315,7 +320,7 @@ To upgrade Docker CE, download the newer package file and repeat the
1. Uninstall the Docker CE package:

```bash
$ sudo apt-get purge docker-ce
$ sudo apt purge docker-ce
```

2. Images, containers, volumes, or customized configuration files on your host
Expand Down