Docker
A tool that packages an application with everything it needs into a container image that runs the same way everywhere.
- Type
- Container platform
- Created by
- Docker, Inc. (engine open source, Apache 2.0)
- Produces
- Container images, built from a Dockerfile
- In my stack
- Every backend service, from laptop to production
What it is
A container image holds an application and everything it needs to run: its code or binary, libraries, system files and settings. A container is that image running, isolated from everything else on the machine. Unlike a virtual machine, it shares the host’s kernel, so it starts in a second and uses little memory.
Images are described in a Dockerfile, built once, stored in a registry, and run unchanged on a developer’s laptop, in the CI pipeline, and in production on a server or on Kubernetes. Docker Compose starts several containers together, such as an API, its database and its cache, with a single command.
Why I use it
“It works on my machine” goes away. The image that passed the tests is exactly the one that goes to production, byte for byte.
New developers start in minutes. One command brings up the whole stack locally, database included, with no long setup guide.
Small images are safer. A multi-stage build keeps compilers and tools out of the final image. Less software inside means fewer vulnerabilities for a scanner to find and less for an attacker to use.
Portable between clouds. The same image runs on Azure, at OVH or with any other provider, which keeps options open.
Where I use it
The backend of the HR management system ships as a Docker image. Written in Go, it compiles to a single binary that goes into a minimal image, built in the CI/CD pipeline, pushed to a registry and then run on Azure AKS. Locally, I use Docker Compose to start an API with its database and cache, so development runs on the same stack as production.
Best use cases
- Deploying any backend service, whatever the language, in a consistent way.
- Local development environments that match production, set up with one command.
- CI pipelines where tests run in clean, repeatable environments.
- Moving an app between servers or clouds without reinstalling everything.
When I’d use something else
A static site or a frontend on Vercel needs no container: the platform builds and serves it. Apps with heavy graphical interfaces, or software that must run directly on Windows desktops, aren’t a natural fit either. And a container doesn’t make an app secure on its own: running as a non-root user, keeping images updated and scanning them still matter.
A small example
A multi-stage Dockerfile for a Go API: the first stage has the full toolchain to compile, the final image contains only the binary.
# Build stage: the full Go toolchain
FROM golang:1.26 AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /api ./cmd/api
# Final image: just the binary, no shell, runs as a non-root user
FROM gcr.io/distroless/static:nonroot
COPY --from=build /api /api
EXPOSE 8080
ENTRYPOINT ["/api"]
The final image weighs a few megabytes. With no shell or package manager inside, there is very little for a vulnerability scanner to flag, or for an attacker to work with.