Docker is an opensource engine, which aims to automates the building, shipping, and deployment of any software applications so that they can run virtually anywhere within a lightweight, portable, and self-sufficient containers, that will run virtually anywhere.
The core of Docker is the container which is a piece of software that includes everything necessary to run the software anywhere.
What docker does is it gives you the ability to snapshot the OS into a common image, and makes it easy to deploy on other docker hosts. Locally, dev, qa, prod, etc, all the same image. Sure you can do this with other tools, but not as easily or fast.
You can have as many Docker container on a single machine, the only limit is the disk space! each container is isolated from each other and from the host machine as well.
So, in a nuthsell, the advantage of using Docker containers is that it eliminates the friction that comes with distributing applications to different locations. For example you could create a Docker container of your Development environment and take it with you and continue working at home on the application, without the fuss of cloning the whole environment.
Which are the main components of Docker ? basically two:
- The Docker engine produces, monitors, and manages multiple containers as shown by the following picture:
- The Docker Hub is the repository of the Docker images that can be eventually mixed in different ways for producing a widely usable and network-accessible list of containers
What is the difference between Docker and a fully Virtualized system ?
In a nutshell Docker is able to use a lot of the host operating system resources. This means that you could have the common parts of the operating system as read only, which are shared amongst all of your containers, and then give each container its own mount for writing.
So let's say you have a container image that is 2GB in size. If you wanted to use a full virtualized system, you would need to have 2GB times x number of VMs you want to create. With Docker you can share the bulk of the 2GB and if you have 1000 containers you might still might have a little over 2GB of space for the containers OS, assuming they are all running the same OS image.