Skip to content

Docker: start here

Docker packages an application and everything it needs to run into an image, and runs that image as an isolated container that behaves the same on a laptop, in CI and in production. This section covers Docker in four pages, in the order you need them when containerizing a real application. The examples follow one invented application, OrdersPortal (an ASP.NET Core API, a Vite front end, PostgreSQL and Redis), so each page builds on the previous one.

Step Page What you get from it
1 Docker images, containers and registries What Docker is, how images and containers relate, the container lifecycle, image tags and digests, Docker Hub and private registries, pushing from CI.
2 Dockerfiles and builds, including multi-stage Dockerfile instructions, build context and .dockerignore, layer caching, multi-stage builds, build arguments and secrets, non-root images.
3 Docker volumes and networking Volumes, bind mounts and tmpfs, volume backups, network drivers, container DNS, internal networks and safe port publishing.
4 Docker Compose and environment variables Multi-container stacks, health-checked startup order, override files and profiles, environment variables, interpolation, precedence and secrets.
If you need to Go to
Explain containers versus virtual machines What Docker is
Pick a tag or pin an image Image names tags and digests
Make an image smaller Multi-stage builds
Use a private package feed during a build Build arguments and build secrets
Keep database data across container restarts Volumes
Let containers find each other by name User-defined networks and DNS
Work out which environment value wins Interpolation and precedence

Docker commands on these pages were not run against a Docker daemon while they were written; they follow the docs.docker.com reference, and are marked β€œnot run here”. Compose files were validated with docker compose config, which works without a daemon.