Docker Basic concepts and installation

Docker 

    Docker is an open-source tool that automates the deployment of an application inside the software container.

  •   What is a Container?

running instance that encapsulates the required software. Containers are always created from images. 

The container can expose ports and volumes to interact with other containers or/and the outer world. 

The container can be easily killed/removed and re-created again in a very short time.

  • What is an Image? 

The basic element for every container. When you create an image every step is cached and can be reused (Copy On Write model). Depending on the image it can take some time to build it. Containers, on the other hand, can be started from images right away.

  • What is a port? 

A TCP/UDP port in its original meaning. To keep things simple let’s assume that ports can be exposed to the outer world (accessible from host OS) or connected to other containers — accessible only from those containers and invisible to the outer world.

  • Volume

can be described as a shared folder. Volumes are initialized when a container is created. Volumes are designed to persist data, independent of the container’s life cycle.

 

Command to install docker in Linux (ubuntu) :

sudo apt-get install docker  
or 
sudo snap install docker 

To check if docker is installed properly or not we can run their hello-world program. 

docker run hello-world

The below snapshot shows the sample output: