liveBook · Manning

Minimal base image

As explained in Learn Docker in a Month of Lunches, Second Edition

A minimal base image is a base container image containing only the operating-system files and runtime components needed by an application.

A minimal base image contains only the operating-system files and runtime components an application needs. In a multi-stage Dockerfile, compiled application artifacts move from a tool-rich builder image into this smaller final image. section 4.4

A practical minimal-image workflow:

  • Copy the binary and required application files, then mark the binary executable on Linux. section 4.4

Image-size comparison

The Go toolset image is 230 MB, while the resulting image-gallery application image is 35.1 MB. Choosing a minimal final base image keeps compiler tools out of the runtime image. section 4.4

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains selection, artifact copying, permissions, and image-size effects, but does not detail the base image’s operating-system contents.
Examples
Uses a Go web application, diamol/base:2e, copied server binary, and 35.1 MB versus 230 MB image sizes.
What it assumes
Assumes basic Dockerfile and Go build knowledge while demonstrating the builder-versus-runtime separation.
What you can do after
Apply via Docker multi-stage builds to produce a smaller runtime image from compiled application artifacts.
How it connects
Connects minimal base images with Docker, multi-stage builds, compiled binaries, and container image size.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.