Docker is an open-source tool to make it easy to create, run, deploy applications using containers. It is also known as “Containerization “. Containers are very popular as they are :
Docker containers are mostly preferred by software developers. Like when the users interact with the software, the hidden complexities drive away from the mind. Deploying and testing the software is really complex these days.
Imagine a jigsaw puzzle, where every piece is placed at the 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.
You can directly install Docker for Windows, when it is installed you can find the service running in the taskbar 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.
Let’s start with an example application to understand docker better.
- Create a default new web application project using visual studio.
- After the application is created, run it locally.
- Next, add Docker Support to your application.
- Make sure Linux is selected.
- A Docker file will be generated, which will contain information regarding how to create a container image for the web application. Now, when we start the project it will run inside docker container.
- Before starting the project inside docker container make sure docker is running on Linux Container.
- 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 a command prompt with command:
docker container ls (It will list out all the containers running inside docker)
Your application is running inside Docker container.