What on Earth is Docker? đ¤
Surely, youâve heard this name before, right?
So, whatâs the deal with Docker and what kind of mess does it untangle?
Docker is a lifesaver in many ways, and to wrap your head around it, letâs first look at the headaches it solves, and then weâll dive into the delightful solution Docker offers. đ
Let me paint a simple scenario for you. Imagine youâre working on a project on your computer. Youâve got a specific version of PHP and some other nifty programs all cozy with your PHP setup. Then, one day, you decide to shake things up and change your computerâs operating system. đť
Naturally, your first instinct is to reinstall all the dependencies your project needs, like PHP and whatnot, so you can get back to work smoothly, right?
But as you go about reinstalling these things on your computer, you end up with a different PHP version than the one you were using for your project. And as soon as you try running the project, youâre bombarded with a flurry of errors because of the PHP version mismatch. Now youâre stuck editing and updating the project to make it behave. đŤ đŤ
Not sure if you got the point yet? đ§
Iâve got another example, and this oneâs a real gem. Picture this: youâve just joined a team at a company. Theyâve been working on a project for a while before you joined, and now you want to jump in, roll up your sleeves, and run the project on your machine.
You grab their project, fire it up on your computer, only to find out that itâs not working because it relies on a specific version of programs and tools that are nowhere to be found on your computer. So, youâre back to square one, facing the same old problem. đ
Now, I donât mean to rain on your parade, but fixing this kind of problem can take ages. And letâs say you decide to switch your operating system again, guess what? Youâll be back to dealing with the same old issue. And if someone else joins the team, theyâll be in the same boat, and the cycle continues endlessly. Phew! đ¤
So, how do you tackle this problem when youâve got two projects, each requiring its own set of programs?
Enter Docker, the knight in shining armor here to rescue us from all these headaches. đ
But wait, how does Docker work its magic? â¨
If you take a closer look at Dockerâs logo, youâll catch a glimpse of its core concept.
The logo depicts a ship ferrying things from one place to another, with workers loading and unloading the shipâs cargo.
Hereâs the gist: we create a file containing all the instructions our project needs, which we call a Dockerfile.
Next, we build that file with a super simple command, which gives us something called a Docker Image. And let me tell you, this Image is packed with all the tools our project craves. đ
Now, when youâre ready to run the project, you spin up something called a Container from the Image, and voilĂ ! It runs smoothly, regardless of the PHP version on your computer or the tools it has, because the Container has everything the project needs. No fuss, no muss. đ
And that, ladies and gentlemen, is how Docker swoops in and saves the day. âĽď¸
So, if you found this post helpful, give it a like and share it with your pals. đĽ°đĽ°
Iâll also provide some sources for those craving more details.
Reference:
https://docs.docker.com/
Thank you for reading!
P.S:
You can follow me:
https://www.linkedin.com/in/omarwaleedzenhom/
https://www.facebook.com/OmarZenho
My Portfolio:
https://omarzen.github.io/Omar-Zenhom/
Top comments (0)