Docker

 

Docker is an open source tool to make easy to create, run, deploy applications using containers. It is also known as "Containerization ". Containers are very popular as they are :

>> Flexible

>> Interchangeable

>> Portable

>> Lightweight

 

Why Docker ?

Docker containers are mostly preferred by software developers. Like when the users interact with the software, the hidden complexities drive away the mind. Deploying and testing the software is really complex these days .

Imagine a jigsaw puzzle, where every piece is placed at right place in order to work properly, if any one piece is lost the entire puzzle falls apart.

The same applies to the software, while developing or testing and compiling the whole project on any other machine, if any libraries etc. are been skipped the whole software falls apart.

Installing Docker

 

You can directly install docker for Windows, when it is installed you can find the service running in task bar with Docker icon.

 

Commands to check docker version and images :

 

>> docker --version : Checks for docker version

>> docker info : Checks for the detailed information about Containers, images etc. 

 

Docker app

 

Let's start with an example application to understand docker better.

 

  1. Create a default new web application project using visual studio.
  1. After the application is created, run it locally.

  2. Next, add Docker Support to your application.

 

 

  1. Make sure Linux is selected.

 

  1. A Docker File will be generated, which will contain information regarding how to create container image for the web application . Now, when we start the project it will run inside docker container.


 

  1. Before starting the project inside docker container make sure docker is running on Linux Container.

 

  1. After the web app is running in docker, we can check the docker container to make sure our application is running in docker. We can do this from command prompt with command:

           docker container ls (It will list out all the containers running inside docker)

 

Your application is running inside Docker container.