Compare Alpine, Debian-slim, Ubuntu, distroless and scratch base images.
IntermediateConceptImages, Layers & Storage Drivers
Answer
- Ubuntu/Debian: glibc, apt, large (70-120 MB) but maximum compatibility.
- Debian-slim: glibc, ~30-75 MB, fewer packages.
- Alpine: musl libc and busybox, ~5-8 MB. Small, but musl can break glibc-compiled binaries and be slower for some workloads (DNS, Python wheels).
- Distroless: no shell or package manager, only runtime and CA certs/tzdata; smaller attack surface.
- scratch: nothing at all.
More on Images, Layers & Storage Drivers
What is a Docker image made of?BeginnerWhat is a layer and when is one created?BeginnerWhat is a union filesystem / OverlayFS?IntermediateWhat is copy-on-write (CoW) in containers?IntermediateWhy does deleting a file in a later `RUN` not shrink the image?IntermediateWhat storage drivers does Docker support and which is default?Intermediate