Installation of Docker CE on Ubuntu 16.04

In my recent article I described the process of setting up the Sql Server vNext on a Linux machine and the Docker was the most crucial tool used for that. Although the Docker server was required, I didn’t show you how to install it properly. This article should fill the hole.

Requirements

The only assumption for this article is that you already have an instance of Ubuntu 16.04 (64-bit) and at most 30 minutes of spare time. So, ready, steady and go!

Installation process

Let’s begin with checking whether curl is available in the system. I prefer to use which command for such a purpose – it shows a path for an executable linked with a passed command. If the which returns nothing I know the command doesn’t exists, at least until it’s installed. Please take a look at the console output below. It illustrates the case when curl is needed to be installed.

When the curl is ready to work I will use it for adding official GPG key from Docker’s server:

Let’s move to the next step.  I will just add Docker repositories to the OS. Docker’s help suggests to use lsb_release command for obtaining Ubuntu distribution name which is needed for pointing out proper repository. I follow this suggestion:

When OS has any new repository it is always necessary to get information about packages which the repository serves. Let’s do it:

As expected, the Docker repositories responded with lists of available packages. It means the Docker is ready to be installed:

It’s almost ready. Before I run the first container it’s worth to add my current user to the docker group. As a result I will be allowed to use docker without root privileges (just after the reboot).

The groups command shows clearly the user is now in docker group. It means it’s time for the final attempt – running hello-world container.

Success! I hope I was right at the the beginning that the entire process takes less than 30 minutes.

Summary

The Docker installation on Ubuntu 16.04 is simple task. Most of the time is consumed by repository preparation, but when this step is finished we are on a good way to have Docker ready to work. I hope this kind of illustration was helpful for you and made you work easier.

Author: Mateusz Chmielewski

Senior software developer at VTS Software.

One Reply to “Installation of Docker CE on Ubuntu 16.04”

Leave a Reply

Your email address will not be published.