googleads
How To Install Docker CE on Ubuntu | DevOps Engineer
DevOps Technical

How To Install Docker CE on Ubuntu

Docker is an application which makes the application processes easier to run in container. On other hand, Docker remains portable, user friendly and an ideal tool for developers.
 While using docker, You can use the Docker CE to maintain the and give the native app experience. On other side, Docker CE is a community edition which provides integrated support and better optimization depends on the infrastructure we use. With help of Docker, we can easily deploy the container-based applications.

Before installing Docker CE on Ubuntu, Let’s figure out the prerequisites,

Prerequisites:

OS requirements: To install Docker CE, you need 64-bit processor from one of these below listed Ubuntu versions:

Bionic 18.04 (LTS)

Artful 17.10

Xenial 16.04 (LTS)

Trusty 14.04 (LTS)

 

Supported storage drivers:

Docker CE on Ubuntu supports ‘overlay2’ and ‘aufs’ storage drivers.

For new installations, ‘overlay2’ is supported on version 4 and higher version of the Linux kernel and preferred over ‘aufs.’
‘aufs’ is supported on version 3 of the Linux kernel because that kernel version does not support overlay or ‘overlay2’ drivers.

If you need to use ‘aufs’ then you need to do additional preparation as outlined below.

Xenial 16.04 and newer

For Ubuntu 16.04 and higher versions, the Linux kernel will support for OverlayFS, and Docker CE uses the overlay2 storage driver by default. If you need to use aufs instead then you need to configure it manually.
If the AUFS driver is loaded into the kernel once you start Docker, and no other storage driver is configured because Docker uses it by default.
Use the following command to verify that your kernel supports AUFS.

 

After passing the command, it will show the result whether the kernel supports AUFS or not.

nodev aufs

You can check which storage driver is Docker using.

 

Response will be like:

 

If you are using a different storage driver, either AUFS is not included in the kernel (in which case a different default driver is used) or that Docker has been explicitly configured to use a different driver.

Check in ‘/etc/docker/daemon.json’ or the output of ‘ps auxw | grep dockerd’.  We can use ‘–storage-driver’ flag to check whether the Docker is started or not.

Trusty 14.04 (LTS)

Unless you have a strong reason not to install the linux-image-extra-* packages then go with Docker which allow us to use the aufs storage drivers.

 

 

The above commands will help us to install the packages.

Related: How To Deploy a Golang Web Application with Docker

Install using the repository

Before installing Docker CE for the first time, you need to set up the Docker repository on your system. Later, you can install the Docker from the repository. If you already have Docker repository in your system then you can skip the step1 and continue from step2.

Step1: Set Up The Repository

Update the apt package index using this command,

 

Install packages to allow apt to use a repository over HTTPS,

 

Add Docker’s official GPG key:

 

Now, you can verify whether you have the key or not with the help of fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.  You can do it by searching the last 8 characters of the fingerprint.

 

Check Out: 9 Tools Everyone In The Devops Industry Should Be Using

Use the following command to set up the stable repository.

 

Note: Starting with Docker 17.06, stable releases are also pushed to the edge and test repositories.

Step2: Install Docker CE

Update the apt package index.

 

Install the latest version of Docker CE, or go to the next step to install a specific version:

 

To install a specific version of Docker CE, check the available versions in the repo, then select and install:

a). List the available versions in the repo:

 

b). Now you can Install a specific version by mentioning  its fully qualified package name. For example, the package name (docker-ce) “=” version string (2nd column). Here am giving like, docker-ce=18.03.0~ce-0~ubuntu.

 

The Docker daemon starts automatically.

Verify that Docker CE is installed properly by running the hello-world image.

 

The above command downloads a hello-world image and it will run it on a container. When the container runs, it prints a specified hello world message and exits.

Finally, We’re done with installing Docker CE on Ubuntu and it would run successfully.  Eventually, you can use sudo to run the Docker commands. now, you can start writing docker images and push the images into the container and run the containers.
Docker, this open source container helps developers and system admins to deploy applications and also to maintain the applications in safest and easiest way.

That’s all we done guys, Go ahead, give a try and share us your awesome results with others. Likewise if you like to read more about Docker or other significant technologies then keep an eye on our largest blog repository where you can get more technical updates. For more inquiries reach us via info@agiratech.com

The following two tabs change content below.

Reddy Sai

Young Senior Software Developer having 2+years of experience in Web development, skilled in Golang, Ruby, AngularJS, Ruby on Rails & NodeJS. With handful of skills he keep thriving through all the Edge of Web development to become a perfect full stack Golang Expert. Besides, this young techie will always buzz up & surprise us with his beautiful Music collections.

Leave a Reply

Your email address will not be published. Required fields are marked *