I have been hearing about Docker for almost an year now. I have been occasionally reading about it here and there, but didn’t actually tried my hands on it. Recently, I thought of taking up a challenge for myself and learn at least the basics of Docker and do some real world tasks around it. After spending a couple of weeks reading, watching and practicing Docker, I thought of putting up a series that could be helpful for Docker Noobs like me.
Docker for Noobs Series:
Part 1 – What is Docker?
This would be a multi-part series where I would try to share my understanding and learnings about Docker and possibly put it a very simplified manner. I hope you would like it and in case there are any comments or thoughts, all would be welcomed.
So, in this Part 1 of Docker for Noobs series, I would try to explain what is Docker, it’s benefits etc.
What is Docker?
Before we actually start understanding Docker itself, let us get a brief understanding about Linux Containers.
Linux Containers or LXC is an operating system level virtualisation method that allows running of multiple isolated linux instances on a single host or Linux instance. So you can think of it like a single machine running multiple Linux instances which are independent of each other in terms of processes and applications being run. This is a concept that has been in existence since quite a while and were majorly used by enterprises.
Docker started as a proprietary technology of a French company named dotCloud and became Open Source in early 2013. Docker was built on the concept of LXC only but when it became open source, it replaced LXC with its own libcontainer library. This has further been upgraded to runC.
Just like LXC, Docker also provides the ability to run multiple instances or containers over a single host machine.
Docker Containers vs Virtual Machines
Docker Containers can be thought of as Virtual Machines but in actual they aren’t. They are compared to virtual machines because they somewhat behave like them. They have their own small and kind-of OS and applications running above it. While Virtual Machines require a full-fledged operating system and system resources allocation, Docker Containers don’t require these and have significant performance boost and smaller footprints.
Docker Benefits in Real World
Main advantage of Docker is that it enables easy distribution and setup of development or production environments across different systems. It is a key component now-a-days in the DevOps environment. As the containers are packaged as isolated instances running their own set of applications, it remains same across different systems. Hence, the environment on which it would be running becomes of less relevance, as the actual application will always use the environment that is within the container and not the one which is outside the container. Similarly, when this application code needs to be moved to a production server, the environment over there as well becomes of less significance. This way Docker helps both the Developers and the Operations.
This can be explained with a real life example as follows:
Developer 1 uses Windows OS and Python 2.7 for developing an application. He has coded the application as per his environment. At the same time, a Developer 2 joins the team but has a Ubuntu OS and Python 3.7. In order to start developing on the same codebase, he would have to setup a development environment such that it is compatible with the previous developers’ so as to make the application run in correct manner. Similarly, when this has to be pushed Live, the Operations Team will have to setup an environment on the production server as per the one required by the developers to ensure code runs smoothly. This whole process could be quite time consuming and overhead on all team members.
But if the Developer 1 packages the code as a Docker Container which has necessary libraries and environment to run the code, the container would be portable enough to be used by any developer and even the operations’ guy to deploy on any host environment and get going.
So, this brings end to our Part 1 of Docker for Noobs series where I have tried to explain what Docker is and how it benefits you as a developer or an operations’ team member. In the next part of this series, we will start with setting up of Docker on your machine and run some commands.