How to choose a Docker base image
Updated 2026-11-17
Short answer
Choose a base image that is still supported, as small as your application allows, updated often and pinned to a version or digest. Most of the vulnerabilities in a container image come from its base, so this one decision removes more findings than any other.
What to look at
- Support: is this release still getting security patches, and until when?
- Size: fewer packages means fewer vulnerabilities and a smaller attack surface.
- Update policy: how quickly are fixes published?
- Provenance: is the image signed, and by whom?
- Compatibility: does your application need glibc, a shell or a package manager at run time?
Pin it
A tag such as latest changes under you. Pin to a specific version, or to a digest when you need the build to be repeatable, and update the pin on purpose.
Use a multi-stage build
Build in an image that has the compilers and tools, then copy only the result into a small final image. The build tools never reach production.
How scancontainer helps
Each report recommends a base image with verified provenance and lists the problems that disappear if you switch.