Physical Address
Metro Manila, Philippines
Physical Address
Metro Manila, Philippines
To get started with Docker on Ubuntu, make sure you meet the prerequisites, then install Docker.
To install Docker, you need the 64-bit version of one of these Ubuntu versions:
Unless you have a strong reason not to, install the linux-image-extra-*
packages, which allow Docker to use the aufs
storage drivers.
$ sudo apt-get update
$ sudo apt-get install -y --no-install-recommends \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
You can install Docker in different ways, depending on your needs:
Before you install Docker for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install, update, or downgrade Docker from the repository.
apt
to use a repository over HTTPS:
$ sudo apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
$ curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
Verify that the key ID is 58118E89F3A912897C070ADBF76221572C52609D
.
$ apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
pub 4096R/2C52609D 2015-07-14 Key
fingerprint = 5811 8E89 F3A9 1289 7C07 0ADB F762 2157 2C52 609D
uid Docker Release Tool (releasedocker) <do****@do****.com>
Note: The
lsb_release -cs
sub-command below returns the name of your Ubuntu distribution, such asxenial
.
$
sudo add-apt-repository \
"deb https://apt.dockerproject.org/repo/ \
ubuntu-$(lsb_release -cs) \
main"
To enable the testing
repository, you can edit /etc/apt/sources.list
and add the word testing
after main
on the appropriate line of the file. Do not use unstable repositories on production systems or for non-testing workloads.
Note: Sometimes, in a distribution like Linux Mint, you might have to change
ubuntu-$(lsb_release -cs)
to your parent Ubuntu distribution. example: If you are usingLinux Mint Rafaela
, you could type inubuntu-trusty
apt
package index.
$ sudo apt-get update
$ sudo apt-get -y install docker-engine
Warning: If you have both stable and unstable repositories enabled, installing or updating without specifying a version in the
apt-get install
orapt-get update
command will always install the highest possible version, which will almost certainly be an unstable one.
$ apt-cache madison docker-engine
docker-engine | 1.13.0-0~ubuntu-xenial | https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
docker-engine | 1.12.6-0~ubuntu-xenial | https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
docker-engine | 1.12.5-0~ubuntu-xenial | https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
docker-engine | 1.12.4-0~ubuntu-xenial | https://apt.dockerproject.org/repo ubuntu-xenial/main amd64 Packages
The contents of the list depend upon which repositories are enabled, and will be specific to your version of Ubuntu (indicated by the xenial
suffix on the version, in this example). Choose a specific version to install. The second column is the version string. The third column is the repository name, which indicates which repository the package is from and by extension its stability level. To install a specific version, append the version string to the package name and separate them by an equals sign (=
):
$ sudo apt-get -y install docker-engine=<VERSION_STRING>
The Docker daemon starts automatically.
docker
is installed correctly by running the hello-world
image.
$ sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
Docker is installed and running. You need to use sudo
to run Docker commands. Continue to Linux postinstall to allow non-privileged users to run Docker commands and for other optional configuration steps.
To upgrade Docker, first run sudo apt-get update
, then follow the installation instructions, choosing the new version you want to install.
If you cannot use Docker’s repository to install Docker, you can download the .deb
file for your release and install it manually. You will need to download a new file each time you want to upgrade Docker.
.deb
file for the Docker version you want to install and for your version of Ubuntu.Note: To install a testing version, change the word
main
in the URL totesting
. Do not use unstable versions of Docker in production or for non-testing workloads.
$ sudo dpkg -i /path/to/package.deb
The Docker daemon starts automatically.
docker
is installed correctly by running the hello-world
image.
$ sudo docker run hello-world
This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.
Docker is installed and running. You need to use sudo
to run Docker commands. Continue to Post-installation steps for Linux to allow non-privileged users to run Docker commands and for other optional configuration steps.
To upgrade Docker, download the newer package file and repeat the installation procedure, pointing to the new file.
$ sudo apt-get purge docker-engine
$ sudo rm -rf /var/lib/docker
You must delete any edited configuration files manually.