Why Docker in layman Term?
Isolate the environment setup from the actual host machine by
providing you a VM-like Docker container.
No matter what host machines your infra team gives you, you can deploy to these
machines if they run Docker. Also, you can control OS for your application
irrespective of the OS for your host machines.
Deploy multiple applications on the same hosts because of the Docker
containers.
It is always painful when you deploy multiple application on the same host machine.
Imagine you have two sails projects, one is running nodejs:5.9.2 and the other is
running nodejs: 6.0.0. It will be a trouble to configure the node version for the two
projects. Fortunately, with Docker container, you just need to specify the node
version and installation in the separate Docker-file. And the nodejs will be installed
in separate containers. The host machine will just need to run the two containers and
things are done.
Besides, for some macro service architecture, it will be much easier to setup if you
need to run multiple services on the same host.
Large community provides different kinds of basic Docker file.
There are lots of basic Docker file that you can start with writing your own, like
nodejs and rails. Even you can just start a Jenkins server by using
docker run jenkins
The Docker engine will pull the required DockerImage and run the Jenkins.
However, there are down sides of using Docker. Yet, to be honest, when you are an
experienced Docker user, you will solve these problems easily.
A large DockerImage will result in a slow export, import and shipping
DockerImage among hosts.
The first thing you SHOULD KNOW about writing Dockerfile is how the
DockerImage is built from the Dockerfile you wrote.
One of the terrible things is like this, you write your Dockerfile command by
command and each command will create a layer to record the actual system change
by that command.
For example, your first command deletes 50MB files from the system. And then your
second command add 30MB file to the system. The layers will treat it as 80MB file
change in total.
Of course, there are best practices to avoid these scenarios.
Dockerfile should be well written in sequences to make well use of
caches.
Every time you build a DockerImage, the Docker engine will cache the layers so that
the building process will be faster next time.