Ever heard the phrase, "But it works on my machine!"?
If you’ve been in tech for more than a week, you probably have. This phrase is the bane of every developer's existence. You spend hours setting up your local environment, only for the production server to throw a tantrum because the PHP version is slightly off or a specific library is missing.
This is where Docker enters the chat.
What exactly is a Container?
Think of a container as a literal shipping container.
In software, a Container is a lightweight, standalone package that includes everything needed to run an application: code, runtime, system tools, libraries, and settings.
Why do we even need it?
Before Docker, we used Virtual Machines (VMs) for project deployment and all. But VMs are "heavy." They include an entire guest Operating System. If you want to run three apps, you run three OSs. That’s a lot of RAM going to waste.
Docker is different. It shares the host machine’s OS kernel. It’s fast, starts in seconds, and uses way fewer resources.
The main wins:
- Consistency: It works on your laptop, your colleague's Mac, and the AWS EC2 instance exactly the same way.
- Isolation: App A needs Node 14, but App B needs Node 18? No problem. They live in their own little bubbles.
- Portability: "Build once, run anywhere" isn't just a marketing slogan anymore.
The Catch: It’s not all sunshine and rainbows ⛈️
As much as I love Docker, we have to talk about the "Problem" with it:
- Persistent Data: By default, containers are ephemeral. If the container dies, your data dies with it. You have to manage "Volumes" to keep your data safe.
- The Learning Curve: Networking between containers can get messy (remember my post on DDEV routing? Yeah, Docker is doing the heavy lifting there).
- Security: Since containers share the host kernel, a vulnerability in the kernel could potentially affect all containers.
As a whole Docker is great for Production Deployment and also for Local Development.
This was a short details of docker, in the next article I will share some basic commands that is essential for in the day to day usage of docker.
Please leave a comment below, if you've like this article or have any kind of queries or suggestions for me.

Top comments (0)