I am new to DevOps and want to learn it but don√Ę‚?¨‚?Ęt know when to use Docker. So, can anyone tell me when to use Docker? What are the scenarios when one should use Docker for running their application in a container on computer or on server? Is it worth to use Docker to run applications in containers instead of VM (virtual Machine)?
When should you use Docker?
Docker has gone through a long evolution since it was released in 2013. It started as a way to provide an easy way of sharing containerized application for deploying on the production. In the next few years, developers learned that Docker is also a good thing when it comes to sharing packaged software fast and easy deployment. There are several good reasons for that, the main ones being:
We can build and test common code in a single machine.
We do not need to change any of the libraries or scripts while deploying on the production server in a Docker container. It is easy to build and deploy application in development, testing or production environment.
We can share a common setup script with many stockholders involved in the project
We can even share the code once we are done with the development workflow, we don't have to pull all necessary build, test or deployment scripts at one time. That was also the case when it came to Docker containers.
Docker has been a big breakthrough for the Open Source DevOps world. What's new now are the benefits of using Docker for the Linux/Windows/Mac container ecosystem.
As per the Docker documentation, a container or a set of containers are a way of executing a process that requires access to a shared environment or files and resources on the host computer yet application runs in separate secure environment.
Docker and Open Source
Docker Images can be run on several operating system having Docker containers installed there. That means that we might be using Docker on Mac, Linux, Windows, or on other platforms besides the Linux platform. In any case, the benefits of using Docker are pretty much the same for every platform and provides easy deployment across the platforms.
A Docker image
A container is a representation of a running process of an application or a specific group of processes. The images are referred to a package of software along with its dependency that can be run Docker in the Docker engine.
When to use Docker?
Docker is used to run the contanerized application that don't need complete Operating system control. For example for running Spring Boot application or Node.js application you just need the Java or Node.js respectively run the application. In this case you can package your application in a Docker container with all dependencies in a Docker image and run on the Docker container.
You can use Docker to run services such as Nodejs application, nGinx, Apache server, Mongo, Mysql, Tomcat, Spring Boot applications or any such application which can run in secure container and there is no need to access complete operating system.
Use Docker in multiple phases of your application development and deployment. For example you can use Docker image to deploy your application in testing and integration testing environment.
You can also use Docker in your production environment to deploy multiple instances of your application to serve high transactions.
Docker can be use to deploy multiple application on production cluster or in cloud environment. This way you can use your server in much better way.
You can check Docker tutorials at: