Docker has been in the market for years and gained so much success. According to Docker, over 3.5 million applications have been placed in containers using Docker technology and over 37 billion containerized applications have been downloaded. Thousands of companies are using them. People now start recruiting DevOps engineers who can leverage the magic of Docker into the enterprise’s product.
Then what is it? If we do a quick search on the internet, we can easily find some short definition of it. “Docker is an open source software platform to create, deploy and manage virtualized application containers on a common operating system (OS), with an ecosystem of allied tools”. Ok fair enough, but these are really big words. What is a virtualized application containers? What is an operating system? What is the ecosystem? More and more questions surrounding these concepts will come up if you are not really a DevOps. I myself also found hard times to understand all of these bizarre terms.
So if we are to explain this thing to a newbie, who has no experience in software packaging/deploying at all, what should we say?
What is Docker?
Let’s remember is there any time we are trying so hard to install a software/game into our laptop, but somehow some error keeps appear? The installer may report there is a missing file here or there? If you are installing a game, maybe it’s a missing .dll file in the system. If you are installing software, maybe there is a required library. So what we did that time? We need to go to Google and search for a solution. Found the solution, yay! But it appears another one. Then we go and find solutions for the new issue. This keeps repeating and repeating until all dependencies are fulfilled. So the flow looks like this:
It works, but no one what this to happen. Neither the developer or the user. Yet it’s still happening and become a pain in the ass. Therefore, a question appears, what if we can achieve a state where the user only takes one time to install the software. There would be no error appears, and heaven is here. This is what Docker trying to do, and they did it.
How Docker do it?
The reason why a piece of code that successfully ran in the developer’s machine, but failed to do so in the user’s one, most of the time, it is because of the difference in the computer’s environment. So the idea of Docker is instead of shipping not only the piece of code to the user, we deliver the whole environment that exactly the same in the developer’s machine.
To run the software with needed dependencies, Docker uses one thing call containers. The container is a running process along with a subset of physical allocated resources on your laptop. If a user’s laptop is a big house, then the container is a very special room that Docker chopped it for this software. When this software runs, its process including dependencies will all be functioned in this special room.
In order to do so, developers create a Docker image, which is to store all the execution needed (including dependency installation and software execution) for the Docker container to function. We can think of this as a special design blueprint of the room, like where to put furniture, where/when to turn on the light, fan and air conditioners. These blueprints are usually stored in Docker Hub, which acts like an online library, where users can pull to their machine via the internet.
One beauty of Docker is the fact that it’s lightweight, fast to ship and deliver. For example, the software can utilize the host OS (without the need to run its own OS, aka no need to build a new house), and many software which different (even conflict) dependencies can run together, in their corresponding special rooms. This isolation and resource limitation is done using Namespacing,(maybe somewhat like the room number) and Control Groups/cgroups (like an electricity meter). In this advanced word, Docker also helps the developer to perform an easier CI/CD integration, which then improves the quality and efficiency of product delivery.
That’s all briefly about Docker. So maybe the next time anyone asks, we can describe it more easily.
No responses yet