A base image is the starting container image from which another image is constructed. Its layers provide operating-system files and runtime support before application code and dependencies are added. section 8.2.1
Choose and inspect the base image as part of image-size management:
- A full Debian base contributed 412MB of unnecessary documentation, man pages, and utilities to the checkout API image. section 8.2.1
- A slim production base can exclude build-time tools when paired with a multi-stage Dockerfile. section 8.2.1
- Inspect base-layer sizes with docker history and browse their files with Dive. section 8.2.1
Separating build and production bases
A Python build stage uses python:3.11 to install dependencies, while the production stage starts from python:3.11-slim and copies only the required files. section 8.2.1
Listing 8.6 Inspecting container image layers with docker history
docker history --human --no-trunc your-image:tag #A
Inspect each image layer and its size with docker history before investigating individual files. section 8.2.1







