How to install docker on Ubuntu 16.04

September 26, 2016

How to install docker on Ubuntu 16.04

What is Docker?

Docker is an application that makes it simple and easy to run application processes in a container, which are like virtual machines, only more portable, more resource-friendly, and more dependent on the host operating system. For a detailed introduction to the different components of a Docker container, check out The Docker Ecosystem: An Introduction to Common Components.

There are two methods for installing Docker on Ubuntu 16.04. One method involves installing it on an existing installation of the operating system. The other involves spinning up a dedicated server with a tool called Docker Machine that auto-installs Docker on it.

In this tutorial, you’ll learn how to install docker and use it on an existing installation of Ubuntu 16.04.

How to install docker

Before install Docker, it should required updated packages. To update the packages, use the following command


Use the following command to add the GPG key for the official Docker repository to the system


The sample output should be like this


To add the Docker repository to APT sources, use the following command


To update the package database with the Docker packages from the newly added repository, use the following command


Make sure you are about to install from the Docker repository instead of the default Ubuntu repository. To verify it, use the following command


The sample output should be like this


Notice that, docker-engine is not installed,to install Docker-engine, use the following command


The sample output should be like this


To check whether docker is started or not, use the following command


The sample output should be like this


To start the Docker service, use the following command


To view all the available subcommands of Docker, use the following command


The sample output should be like this


You can search for images available on Docker Hub by using the docker command with the search subcommand.


The sample output should be like this


To see the images that have been downloaded to your computer, use the following command


The sample output should be like this


To run the Docker container, use the following command


Above command runs hello-word container. the sample output should be like this


To listing Docker Containers, use the following command


The sample output should be like this


After this article, you will be able to understand – How To Install and Use Docker on Ubuntu 16.04 we will come up with more Linux based tricks and tips. Keep reading!

Save

Save