Docker is a containerization environment. To speak about Docker and its features, we must talk about containers.
Containers are isolated platforms to run our applications. At first, they sound similar to virtual machines. However, there are significant differences between them in their intent and technical details. While containers are for running operating systems, containers are isolated platforms to run processes. These processes could be RESTful Applications, databases or just a timer. That’s why while all VM gets a guest OS, a container does not. Those differences make containers light-weight compared to VM’s.
Docker is a tool to create, run and deploy containers, and since we use containers, Docker ensures that we won’t see a difference between our production and local dev or test environments.
To run Docker containers, we need Docker images. A Docker image is a file which is created from a Dockerfile and has necessary instructions to create containers. You can use public images from Dockerhub to spin-up loads of applications like Nginx, MongoDB, Postgres, Node.JS, and so on.
A great advantage to use docker containers is, to run any process without installing its binaries or dependencies on your servers. With only its Docker image you are good to go. A simple example for this will be; if you need a Redis server, Nginx Load Balancer and Postgres for your app to run, you need to install these and their dependencies to your local or production machine. This can be problematic to use in different servers with different configurations. However, using docker containers, you will be able to spin up those services in any environment and when you want to destruct them, there will be no footprint or leftover dependencies in your servers.