minimal base image
A base image with as little inside as possible, such as Alpine, a slim variant or a distroless image, to shrink size and attack surface.
In more detail
Fewer packages means fewer vulnerabilities to patch and faster pulls. Distroless images contain only your app and its runtime, without even a shell, which makes debugging harder but attacks harder too. The special scratch image is completely empty and suits single static binaries.
Examples
gcr.io/distroless/python3-debian12:nonroot has Python, libc and certificates but no shell or package managerFROM gcr.io/distroless/static-debian12Related terms
- base image — The image a Dockerfile starts from with FROM, which supplies the operating system files and often a language runtime.
- attack surface — Everything an attacker could try to use against a system: open ports, installed programs, accounts and settings.
- multi-stage build — A Dockerfile with several FROM stages, where later stages copy only what they need from earlier ones.
- Alpine Linux — A very small Linux distribution often used as a base image because it is only a few megabytes.
Taught in
- Minimal Base Images: Less To Attack — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Immutable Containers: Read-Only At Runtime — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Container Hardening: Distroless & Rootless — Cloud Security & DevSecOps Engineering
- Multi Stage Builds, Targets And Build Secrets — Docker Architecture & Production Containers
- Minimal Bases, Non Root Users And Smaller Images — Docker Architecture & Production Containers
- Containerization Architecture: Multi-Stage Dockerfiles — Production Full-Stack Engineering
- Shipping in Scratch and Distroless Images — Concurrent Systems Programming with Go
- Containerizing and Testing the Final Build — Concurrent Systems Programming with Go
- Pinned For Stability: Images, Registries And Code — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Production Hardening: Graceful Shutdown & Docker — Node.js Internals & Backend Services
- Container Security: Minimal Bases And Non Root — Application Security & Threat Modeling for Engineers
- Image Scanning And Trivy — Application Security & Threat Modeling for Engineers
References
- Docker docs: choose the right base image
- Dockerfile best practices: choose the right base image
- Docker Hardened Images
- GoogleContainerTools: distroless
- Docker Hub: node official image