sethserver.com Subscribe
A colorful cartoon robot with a blue circular head, orange headphones, and a body made of storage containers (orange shipping containers on the left, pink filing cabinets on the right) stands centered on a beige background. Geometric shapes in blue, yellow, pink, and orange (circles, triangles, squares, hexagons, and cubes) float around the robot.

Containers vs VMs: Docker and friends

By Seth Black • Updated: June 29, 2026

Programming · 6 min read

Like this kind of writing? Get one email a week with notes on startups, AI, and the occasional strong opinion about Python: subscribe to the newsletter.

You can usually tell how a team ships software by how they talk about servers. redhat

If everything lives on "the server" and people get weirdly protective about it, you're probably on a hand-fed VM. If the team says "spin up another instance" like they're ordering fries, you're in container country. Neither is morally superior; they're tools that solve different problems. upwind

What a VM actually is

A virtual machine (VM) is a full fake computer running on your real one. It has its own OS, its own kernel, and its own virtual hardware. More overhead, slower boot, stronger isolation. redhat

That isolation is why VMs are still everywhere. If you're stuck with legacy software that expects "a normal server," or you need hard walls between workloads, a boring VM is still the right hammer. upwind

Containers and why Docker took over conversations

A container is process-level isolation on top of a shared kernel. You're not pretending to be a new computer; you're putting your app in a fenced-off process with its own filesystem and dependencies. redhat

The win is predictability and speed. You bake your app and its config into an image, and that same image runs on your laptop, in CI, and in prod. That's how you kill "it works on my machine." "My machine" becomes a versioned artifact instead of a vibe. scalecomputing

You can still break things. You just break them in a way you can repeat on purpose. redhat

Developer confidence is mostly mechanical

I like systems where you can be wrong without burning the house down.

You pick a database because it's right today. Next month your traffic pattern changes, your access pattern changes, or your boss changes their mind. What keeps you moving is the safety net: upwind

Containers help because they shrink the "weird environment" surface area. If CI runs the same image you run locally, you stop fighting over whose laptop is haunted. redhat

Pets vs cattle in real life

The old analogy still works: VMs are pets, containers are cattle. compiler

VMs (VMware, EC2, long-lived boxes)

VMs usually turn into special snowflakes. You patch them, you SSH into them, you tune configs by hand, and six months later nobody is totally sure what's in there. I've worked places where db-prod-1 got talked about like a moody coworker who "doesn't like restarts." redhat

Containers (Docker, ECS tasks, Kubernetes pods)

Containers are disposable. The image is what you care about: built from a Dockerfile, tagged, stored in a registry. If a container is misbehaving, you don't nurse it back to health, you kill it and start a fresh one from a known-good tag. redhat

Rollback becomes "deploy image v1.8.2 again," not "try to remember what you changed over SSH last night." scalecomputing

A tiny Flask app in a container

Here's a dead-simple Flask setup in Docker:

## Dockerfile
FROM python:3.12-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

ENV PORT=8000
EXPOSE 8000

CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]

Build and run it:

docker build -t myflask:0.1 .
docker run --rm -p 8000:8000 myflask:0.1

Now that exact image can run on your laptop, in GitHub Actions, or on a cheap VPS. Same Python version, same dependencies, same entrypoint. redhat

This is also where I usually get useful fast on a new team. First couple of hours I'm asking: what's broken, where's the repo, where are the logs. There are only so many ways a Flask app plus a database can fail. Containers narrow the chaos even more. If the image doesn't build, we don't need a task force, we need to read the build output.

Why containers fit AI and worker-style jobs

If you're doing jobs that spin up, do work, and disappear (ETL, background workers, batch inference), containers are a clean fit. redhat

You can script this on VMs too, it just feels like renting a moving truck to deliver a sandwich. upwind

Side‑by‑side: VMs vs containers

Feature VM (VMware/EC2) Container (Docker)
Boot time Seconds to minutes redhat Milliseconds to seconds redhat
Isolation Full OS, hardware-level redhat Process-level on shared kernel redhat
Resource use Heavier, one OS per VM redhat Lighter, shared OS kernel redhat
Golden image AMIs, VM templates redhat Container images (tags) redhat
Best for Legacy apps, strong isolation redhat Microservices, CI/CD, batch jobs redhat

The boring answer that actually helps

Use VMs when you need hard isolation or a full OS experience, especially for legacy apps or mixed workloads that shouldn't share a kernel. Use containers when you want fast startup, repeatable environments, and disposable runtimes tied to images. redhat

Then spend your real energy on logs, tests, and backups. That's what lets you move fast without turning every deployment into a horror story. infosecwriteups

-Sethers

Share this post
Newsletter

One email, once a week.

Notes on databases, systems, and the occasional strong opinion about Python. No spam, unsubscribe anytime.

Seth Black
Written by

Seth Black

Engineer and founder based in Texas. Writes about databases, AI, and running things in production. Embeds in small teams as lead engineer.

More from Programming

View all →
Programming

What's the Differences Between Relational, NoSQL, Vectors, and Caches

Apr 14, 2026
Programming

Git and Source Control in AI Land

Apr 14, 2026
Programming

Domains, DNS, and why it feels fragile

Apr 14, 2026