If you do not know what Docker is and which problems it solves, then this post is for you.
Writing code is my full-time job. I enjoy building web applications that solve real problems, and coding is the most exciting part of my job.
Can you guess what the less exciting parts are?
To reply to this question, we need some background. An application needs an environment in which it can run. It could be a bare-metal server, Virtual Private Server (VPS) or a Cloud service like AWS, Azure or Google Cloud.
Whatever the environment is, to be able to run the application needs:
- The Operating System
- The programming languages
- Frameworks and libraries
Also, remember that they must have the correct version and configuration.
It is a demanding task, and once you do it the first time, you want to have a way to replicate and automate the process in order to be faster and avoid mistakes the next time you deploy your application.
Secondly, developers build and test the applications on their computers. To reduce the chances of errors, the setup of the production and developer environment should be as similar as possible.
That isn't easy to obtain because:
- Often, the developers work on different projects, each requiring a different configuration.
- The server and the laptop can easily have a different setup. For example, this happens when you update a library on your laptop but not on the server (or vice-versa). This point is one of the causes of the infamous phrase:
... but it was working on my machine!
To highlight that the application runs without problems on your laptop but not on the production server, even if the code is the same.
Docker is an Open Source tool that solves both problems, making developers happier.
Images and Containers are the two fundamental concepts of Docker.
Docker allows running applications in isolated containers, which can be hosted in any laptop, server or Cloud service, as long as these support Docker.
To share the images, you can easily use services like Docker HUB.
Docker is changing the way developers, and DevOps work with applications. Fortunately, learning the basics is not complicated and worth the effort.
In my next post, I will discuss Docker and its basic commands.
Updated on Dec 2022