If you do not have any idea what Docker is and which problems it solves, then this post is for you.
Writing code is my fulltime job. I enjoy to build web applications that solve real problems, and coding is the most exciting part of my job.
Can you guess what are the less exciting parts?
We need a bit of background. An application in production needs an environment in which it can run. It could be either bare-metal server, Virtual Private Server (VPS) or a Cloud service like AWS, Azure or Google Cloud.
Whatever is the platform, you must install a few things to run your application: the Operating System, the programming languages, frameworks and libraries. Also, do not forget that all of them must have the correct version and the correct configuration.
This is a demanding task, and that is why once you do it the first time, you want to have a way to replicate and automate the process.
Secondly, developers build and test the applications on their computer, usually a laptop. To reduce the chances of errors, the set up of them should be as close as possible to the production servers.
That is difficult to obtain because:
- Often the developers work in different projects, each of them requiring a different configuration.
- The server and the laptop can easily be out of in sync. For example, when you update a library on your laptop but not on the server. This is the main cause of the infamous sentence:
... but it was working on my machine!
To point out that the application is running without problems on your laptop (local), but not on the server (production), even if the code is the same.
Docker is an Open Source tool that solves both of those problems, making developer life easier.
It is based on the ideas of images and containers.
Docker allows running applications in isolated containers, which can be hosted in any laptops, servers or Cloud services, as long as these support Docker.
Images can be easily shared by services like Docker HUB.
Docker is changing the way developers and DevOps work with applications. Learning the basic it is not complicated, and certainly, it is worth the effort.
To know more you can read my next post: Docker and its basic commands
Updated on May 2020