Gangmax Blog

Install Docker on Ubuntu Xenial 16.04

This is the offical instructions from Docker website here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 1. Check if the depended packages are installed or not. In my case, they
# are installed. If they are not in your case, install them with "apt-get".
apt-cache policy apt-transport-https
apt-cache policy ca-certificates
# 2. Install the GPG key before adding the apt source.
$ sudo apt-key adv \
--keyserver hkp://ha.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
# 3. Select the source for specific Ubuntu version. For "xenial" it's:
deb https://apt.dockerproject.org/repo ubuntu-xenial main
# 4. Write the source expression you selected into apt source file:
echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | sudo tee /etc/apt/sources.list.d/docker.list
# 5. Install kernal packages below to enable using "aufs":
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
# 6. Check your configured source taking effect and install Docker engine.
apt-cache policy docker-engine
sudo apt-get install docker-engine
# 7. Start Docker service.
sudo service docker start
# 8. Pull and run a Docker image to verify the installation is successful.
sudo docker run hello-world
# 9. Add your login account into the "docker" group to run Docker command
# without "sudo".
sudo groupadd docker # The group may exist already like my case.
sudo usermod -aG docker $USER
groups $USER

Comments