·7 min read

When to Use Docker vs Alternatives - A Practical Guide

When Docker is the right call, and when VMs, Podman, containerd, Kubernetes, or serverless fit better. Decision rules, not hype.

"Should we use Docker?" is the wrong question. The real question is: "What problem are we trying to solve?"

I've watched teams Docker-ify their entire stack because "everyone uses Docker," only to realize they've traded simplicity for complexity without gaining much. I've also seen teams avoid Docker for too long, manually managing dependencies across 50 servers.

Both extremes hurt. Here's when Docker actually makes sense, and when it doesn't.

Bottom line: Use Docker when you need environment consistency or microservices. Use VMs when you need real isolation or a different OS. Use Podman when security policies block Docker's daemon. Use Kubernetes when you're managing containers across many servers. Use serverless when you just want to run code without managing anything. Don't use containers at all if you're happy with Heroku or a simple VPS.


The Honest Truth About Docker

Docker solves real problems. But it also introduces new ones:

  • You now need to understand images, layers, registries, networking, and volumes
  • Your deployment process gets longer (build image, push to registry, pull, run)
  • Debugging inside a container is different from debugging on a server. Half the images you pull don't even have a shell or curl
  • You need to secure the Docker daemon, scan images for vulnerabilities, and keep base images patched

This trade-off is worth it in many cases. Not all.

When Docker is the Right Choice

"Works on my machine." This is the original reason and still the best one. Your Python app works on developer laptops but fails in production because of a different libssl or a different minor Python version. A Dockerfile pins the exact interpreter, libraries, and config, and the same image runs in CI and in prod. If your team keeps losing hours to environment drift, Docker pays for itself fast.

Microservices. One service, one image, its own dependencies and resource limits. Auth, inventory, and payments can each be built, deployed, and rolled back without touching the others. If you have one monolith, this argument doesn't apply to you.

Simpler deployments. A Node.js app that used to need "install Node, npm ci, set env vars, configure pm2/systemd" becomes docker run -d --env-file .env -p 3000:3000 myapp:1.4.2. The server only needs a container runtime.

Legacy apps you can't rewrite yet. A 10-year-old Java app that nobody can set up on a fresh server anymore. Containerizing it freezes the working setup in a Dockerfile and buys you time. It doesn't modernize the app, it just makes it portable.

When Virtual Machines Are Better

You need real isolation. Containers share the host kernel. A kernel exploit in one container is a host problem. VMs each run their own kernel, which is why hosting providers and multi-tenant platforms still put untrusted customers behind a hypervisor (or use VM-backed sandboxes like Firecracker or Kata Containers when they want container ergonomics with VM isolation).

You need a different OS. Linux containers need a Linux kernel. Docker Desktop on Mac and Windows quietly runs a Linux VM for you. Windows containers need a Windows host. If you test on Windows, macOS, and several Linux distros, that's VMs.

The app depends on the OS itself. The old ERP that needs a specific Windows Server version, registry settings, and system services. Or anything that needs its own kernel modules or a specific kernel version. Don't fight it into a container.

You want hardware dedicated to one tenant. VMs let you pin CPU cores and pass whole devices (PCI passthrough) to one guest. Note that GPUs alone are not a reason to pick VMs: containers use GPUs fine through the NVIDIA Container Toolkit, and on Kubernetes through the GPU Operator. VMs make sense when you want a hard boundary around that hardware.

Podman, containerd, and the Rest of the Toolbox

"Docker" usually means three things at once: the CLI, the dockerd daemon, and the image format. The image format is the OCI standard now, so every tool below builds or runs the same images. You're choosing tooling, not a different kind of container.

Podman is the main Docker alternative on a workstation or a single server. No central daemon, rootless by default, and the CLI is close enough that alias docker=podman works for most day-to-day commands. Where it's actually different:

  • Rootless out of the box. If your security team won't allow a root daemon on the box, Podman is the easy answer. To be fair to Docker, it has a rootless mode too, it's just not the default and not what most install docs set up.
  • systemd integration. With Quadlet you drop a .container file in /etc/containers/systemd/ and systemd runs and restarts the container like any other service. For a single server or an edge box with no orchestrator, I like this more than docker compose plus restart: always.
  • Kubernetes YAML. podman kube generate turns a running container or pod into Kubernetes YAML, and podman kube play runs Kubernetes YAML locally. Handy for prototyping, but treat the generated YAML as a starting point, not a production manifest.
  • Podman 6 (mid-2026) removed a lot of legacy: cgroups v1, CNI, slirp4netns, and iptables are out in favor of Netavark, pasta, and nftables. If you run Podman on an old distro or have scripts that assumed CNI, check before you upgrade.

docker compose files mostly work through podman compose, but if your team lives in Compose and Docker Desktop, the switch has friction. Test your real compose files before promising anyone a migration.

containerd is what's actually running containers under Docker itself, and under most Kubernetes clusters. Kubernetes removed dockershim in 1.24 (2022), so your nodes run containerd or CRI-O and talk to it directly. Your Docker-built images run there unchanged. On a node, debug with crictl ps and crictl logs, not docker ps. There's often no Docker on the node at all.

nerdctl is a Docker-compatible CLI for containerd. Useful when you're on a containerd host (or in Rancher Desktop / Lima) and want nerdctl run, nerdctl compose, and nerdctl build without installing Docker.

Buildah builds OCI images without a daemon, either from a Dockerfile or step by step from a script. Podman uses it under the hood for podman build. You'll mostly meet it in CI pipelines that aren't allowed to mount the Docker socket. BuildKit (what docker build uses now) and Kaniko cover the same ground. Kaniko was archived by Google in 2025, so don't start new pipelines on it.

On a Mac, the choice is mostly about the Linux VM: Docker Desktop, Podman Desktop, Rancher Desktop, Colima, or OrbStack. Remember that Docker Desktop needs a paid subscription for companies above 250 employees or $10M revenue. That alone moves a lot of teams to one of the others.

When Kubernetes Makes Sense

Kubernetes is an orchestrator, not a Docker replacement. It adds a lot of power and a lot of complexity.

Many servers. Once you're placing containers across a fleet of nodes and need automatic rescheduling when one dies, you need an orchestrator. One or two servers with Compose is fine. Twenty servers with a hand-written deploy script is not.

Real autoscaling. An API that spikes 10x during events and needs to go from 3 to 30 replicas on its own. HPA scales on CPU/memory, and KEDA scales on queue length, Prometheus queries, or other external signals.

Lots of services talking to each other. Service discovery, internal load balancing, config and secrets, rolling updates. With 50+ services, Kubernetes gives you a common way to do all of this instead of 50 snowflakes.

If none of those apply, Kubernetes is overhead. Somebody has to upgrade the cluster every few months, and that somebody is you.

When Serverless is the Answer

Event-driven work. Resize an image when a user uploads it. Process a message when it lands in a queue. Nothing runs in between.

Spiky, unpredictable traffic. A newsletter signup endpoint that gets nothing for weeks, then thousands of hits during a campaign. Scale-to-zero and back without pre-provisioning.

Tiny workloads. A contact form that processes 10 submissions a month should cost close to nothing. A VM or a cluster for that is silly.

Watch the other end: at steady high traffic, per-invocation pricing gets expensive, and cold starts and execution time limits will bite latency-sensitive or long-running jobs. Many platforms (Cloud Run, AWS Lambda container images) take a container image anyway, so Docker skills still apply.

How I'd Decide

  • Small to medium app, a few servers: Docker (or Podman) + Compose. Serverless for event-driven side jobs. No Kubernetes until you're actually running across multiple servers and feel the pain.
  • Enterprise: VMs where compliance or isolation demands it, containers for new and modernized services, Kubernetes for the large-scale platform. Expect to run all three.
  • Startup moving fast: Managed everything. Serverless or a managed container platform. Delay running your own orchestration until scale forces it.
  • Legacy systems: Leave them on VMs, containerize the pieces around them, and don't do a big-bang migration without a business reason.

A few things I'd say to almost every team:

  • Don't pick Kubernetes for small deployments. The operational cost is real and constant.
  • Don't containerize everything at once. Some apps are fine as they are. Change for a clear benefit, not because of a trend.
  • Don't ignore what your team can operate. The best tech is worthless if nobody can debug it at 2 AM.
  • Count the full cost. Training, maintenance, and on-call time, not just the cloud bill.

You can change course. Start simple, prove value, and add complexity when the problem actually shows up.


A note on how this was written: I used AI to help with phrasing and structure. The tone, the opinions, the war stories, the code, and everything else here are mine.