Docker overview for Beginners

Abdullah Al Jahid
4 min readJun 14, 2021

Docker is a containerization platform that packages your application and all its dependencies together in the form of a Docker Container to ensure that your application works seamlessly in any environment.

In this article, we will try to find out the answers to the following questions.

  1. What is Docker and why it is important?
  2. What is Docker Container
  3. What is Docker Image
  4. Installation of Docker

Now let’s get started….

What is Docker? Why it is important?

Docker

Docker is a containerization platform that packages your application and all its dependencies together in the form of a docker container to ensure that your application works seamlessly in any environment.

The image is taken from the internet.

Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they’re running on and only requires applications to be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.

What makes docker so important?

Docker has become a universal software delivery tool, regardless of its structure, dependencies, or installation method. All that is needed for programs distributed through Docker is inside the image and does not intersect with the primary system and other containers. The importance of this fact cannot be overestimated. Now updating software versions does not involve either the system itself or other programs. Nothing can break anymore. All you need to do is download a new image of the program you want to update. In other words, Docker removed the dependency hell problem and made the infrastructure immutable. This gives a significant performance boost and reduces the size of the application. Docker helps both developers and system administrators, making it a part of many DevOps (developers + operations) toolchains.

Docker Components

Docker is composed of the following four components

  1. Docker Client and Deamon
  2. Docker registry
  3. Docker Container and
  4. Docker Image

What is Docker Container?

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container is a lightweight, standalone, executable package of software that includes everything needed to run an application (code, runtime, system tools, system libraries, and settings). It could be an Ubuntu container, CentOs container, etc. to fulfill the requirement from an operating system point of view. Also, it could be an application-oriented container like a CakePHP container or a Tomcat-Ubuntu container, etc. Docker container can be shipped anywhere and it is unable on any operating system without installing a single dependency.

From Internet

What is Docker Image?

If you’ve ever used virtual machines, you’ll be familiar with images. In virtual machine environments, images would be called something like “snapshots”. They’re a picture of a virtual machine at a specific point in time. Docker images are a little bit different from a virtual machine snapshot, though.

A Docker image is a read-only template that contains a set of instructions for creating a docker container that can run on the Docker platform.

Docker images can’t ever change. Once you’ve made one, you can delete it, but you can’t modify it. If you need a new version, you have to create the image again. If you use the same name then the previous one will be overwritten. This inability to change is a powerful tool for Docker Image. Because this makes it easy to try out additions to your environment, you might experiment with new software packages or try to reorganize your project files as you know that the image will always work, forever.

Docker Image becomes Docker Container at runtime / when they run on Docker Engine.

A Docker image is the set of processes outlined in the Dockerfile. It is helpful to think of these as templates created by the Dockerfile.

Dockerfile

Docker file is the configuration file of a docker image that tells Docker image what to install, update, etc. Basically, the dockerfile says what to build which will be the docker image. This file has everything to eventually build a container. This file includes dependencies, application code folder, installation commands, and everything else that is needed to execute effectively.

Here’s an example. If you want to build an image for a Node.js project, dockerfile will look like the given picture.

You will find more information about Dockerfile here.

If you are up to here, then you have some basic idea about what Docker is and why it is important. Now let’s go ahead with the installation process of docker.

Installation

If you are in a Linux machine, first check if docker is installed in your machine or not. Run the following command in your terminal for this.

$ docker --version

If your machine had docker installed you will output like this. If you didn’t see an output like this then try to install it by using a simple command.

$ sudo apt install docker.io

To check if docker installed successfully or not run docker --version

Thanks for reading.

--

--

Abdullah Al Jahid

Institute of Information Technology | University of Dhaka