DEV Community

Cover image for What Is Docker? Containerization
Omar Waleed Zenhom
Omar Waleed Zenhom

Posted on

What Is Docker? Containerization

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? ✨

Image description

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)