🐳developer

Docker Explained Without the Jargon: What Containers Actually Are

Docker has been around for over a decade and most developers still find the mental model confusing. Here's the explanation that actually makes it click.

PSBy Priya Shah · Senior Software EngineerJanuary 25, 2026Updated February 28, 20267 min read
Free to read

Advertisement

Frequently Asked Questions

What is the difference between a Docker image and a Docker container?+
A Docker image is a static, layered snapshot — a blueprint. It contains the OS filesystem, installed packages, application code, and startup instructions, but it's not running. An image is like a class definition in programming. A container is a running instance of an image — it's the class instantiated. You can run multiple containers from the same image simultaneously, each isolated from the others. When you stop a container, it stops; when you remove it, it's gone, but the image persists. Building an image is a one-time (or occasional) step; running containers from it is the operational step.
How is Docker different from a virtual machine?+
Virtual machines emulate complete hardware and run a full guest operating system kernel. A VM for Ubuntu on a macOS host runs the entire Ubuntu kernel, which then runs your application on top. This provides strong isolation but consumes significant resources — a VM might use 1-2 GB of RAM before your application even starts. Docker containers share the host OS kernel and only package the application and its dependencies. A container might use 50 MB overhead instead of 2 GB. The tradeoff is that all containers on a host share the same kernel, so a kernel-level exploit affects all containers. VMs are more isolated; containers are more efficient.
What is a Dockerfile and what are its most important instructions?+
A Dockerfile is a text file that specifies how to build a Docker image, one instruction at a time. Each instruction creates a new layer in the image. The most important instructions are: FROM (the base image to start from, like node:20-alpine or python:3.12-slim); WORKDIR (sets the working directory inside the container); COPY or ADD (copies files from your local machine into the image); RUN (executes a command during the build, like npm install or apt-get install); EXPOSE (documents which port the container listens on — doesn't actually publish the port); CMD or ENTRYPOINT (specifies what command to run when the container starts). Layer ordering matters: put frequently changing instructions (like COPY . .) after rarely changing ones (like RUN npm install) to maximize build cache reuse.

Advertisement

PS

Priya Shah

Senior Software Engineer · 9+ years experience

Priya has nine years of experience building distributed systems and developer tooling at two B2B SaaS companies. She writes about APIs, JSON/JWT workflows, regex, DevOps, and the small utilities that make debugging faster at 2am.

View all posts by Priya Shah

Tags:

dockercontainersdevopsdeploymentdeveloper