DevOps

My experience with docker

"It works on my machine." I heard that line dozens of times before Docker. Different Node versions, missing system libraries, conflicting dependencies — t...

13 Oct 2023

My experience with docker

"It works on my machine." I heard that line dozens of times before Docker. Different Node versions, missing system libraries, conflicting dependencies — the gap between development and production was a constant source of bugs.

Docker eliminates that gap. It packages your application, its dependencies, and its runtime environment into a single container. That container runs the same way everywhere — your laptop, your CI server, your production cluster.

What Docker actually does

Docker wraps your app in a lightweight, isolated environment called a container. Unlike a virtual machine, a container shares the host OS kernel. That makes it fast to start, small to store, and cheap to run.

You define what goes in the container with a Dockerfile. Base image, dependencies, build steps, startup command — all version-controlled, all reproducible.

The workflow shift

Before Docker: develop locally, pray the production server has the right dependencies, deploy, debug environment differences for hours.

After Docker: develop inside a container, test in the same container, deploy that exact container. What you tested is what runs in production.

This matters most in teams. New developer joins? docker compose up and the entire stack is running in minutes. No "follow the 47-step setup doc" ritual.

Docker Machine and beyond

Docker Machine lets you provision Docker hosts on local machines, cloud providers, or your own data center. It creates the host, installs Docker, and configures the client to connect. Useful for spinning up remote Docker environments without touching the cloud console.

The trade-off

Docker adds a layer of abstraction. You need to learn Dockerfiles, image layering, networking, volume mounts, and orchestration. Debugging inside containers can be less intuitive than debugging on bare metal. Image sizes can bloat if you're not careful with multi-stage builds.

But the consistency it brings — knowing that the same image runs identically everywhere — is worth every bit of that learning curve. Docker changed how I think about deployments. Once you containerize your first production app, manual server setup feels reckless.