Docker Cheat Sheet
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production; see the section bibliography for the reference material consulted while preparing these pages. |
A single-page, colour-coded summary of the Docker essentials — the architecture one-liners (CLI to API to
dockerd to containerd to runc), the image commands, the Dockerfile instruction table with the CMD/ENTRYPOINT
forms and the RUN --mount types, a multi-stage skeleton, the docker run option groups and lifecycle commands,
volume/bind-mount/tmpfs syntax, networking one-liners, the Compose file skeleton and CLI, the Buildx essentials
(--platform, --cache-to type=gha, --sbom --provenance, bake), a security checklist, the clean-up commands,
the Spring Boot mapping (spring-boot:build-image, jarmode=tools extract --layers, spring-boot-docker-compose,
spring-boot-testcontainers with @ServiceConnection, ComposeContainer, Surefire *Test vs. Failsafe *IT) and
the GitHub Actions skeleton (setup-buildx to login to metadata to build-push) — handy for quick
memorization or as a printable desk reference. It reflects Docker Engine 29.8.x, Compose v5.5.x, Buildx 0.37.x
with BuildKit 0.33.x, Testcontainers 2.0.5 and Spring Boot 4.1.x.
For the full explanation, every option, and additional examples, see the dedicated pages:
Foundations — Getting Started with Docker, Docker Architecture and the OCI, and Images, Layers and Tags.
Building images — Dockerfile Fundamentals, Build Cache and Multi-Stage Builds, BuildKit and Buildx, and Image Best Practices and Supply-Chain Security.
Running containers — Running Containers, Storage: Volumes, Bind Mounts and tmpfs, Networking, Resources, Logging and Monitoring, and Debugging Containers.
Compose — Docker Compose Fundamentals and Compose in Practice.
Registries, security and orchestration — Registries and Docker Hub, Docker Security, and Orchestration: Swarm Mode and Kubernetes.
Docker in the Java and Spring Boot development loop — Java and Spring Boot Images, Compose for Local Development, Testcontainers Fundamentals, Spring Boot Integration Tests with Testcontainers, and Docker CI/CD with GitHub Actions.
Other framework bindings — Quarkus: Container Images, Quarkus: Developer Experience, and Quarkus: Kubernetes and OpenShift.