✦ For everyone, free.

Practical knowledge for real and everyday life

Home

3.3.3 Base Image Criteria

A focused guide to Base Image Criteria, connecting core concepts with practical Docker and container operations.

Base image criteria are the factors worth deliberately evaluating when choosing what to put in a Dockerfile's FROM instruction: size, security maintenance, compatibility with required dependencies, and how actively the image itself is maintained and updated upstream.

Size as a Criterion

A smaller base image generally means faster pulls, less storage consumed, and a reduced surface for vulnerabilities, making size a reasonable default tiebreaker when multiple base images would otherwise serve equally well.

docker images --filter reference='python:3.12*'

Comparing the available variants of a given runtime image is a quick way to evaluate this criterion directly before deciding which to use.

Security Maintenance as a Criterion

Official, actively maintained images receive security patches promptly, which matters significantly more over an image's operational lifetime than its initial size — an actively maintained but slightly larger image is often a better choice than a smaller, unmaintained alternative.

docker scan myapp:1.0

Running a vulnerability scan against an image built from a given base is a practical way to evaluate how well-maintained that base actually is in practice.

Dependency Compatibility as a Criterion

A base image's C library implementation, available package manager, and included system libraries determine whether the application's specific dependencies will install and run correctly, which can override a preference for smaller image size if a smaller base turns out to be incompatible.

docker run --rm myapp:1.0-alpine python -c "import numpy"

Verifying that a key dependency actually works correctly on a candidate base image before committing to it avoids discovering a compatibility problem later.

Community and Ecosystem Support as a Criterion

A widely used base image tends to have more available documentation, more third-party tooling tested against it, and a larger community able to help troubleshoot issues, which is a less tangible but still meaningful factor in choosing between otherwise similar options.

docker pull python:3.12-slim
Why Weighing These Criteria Together Matters

No single criterion should dominate the decision in isolation — a base image chosen purely for minimal size that turns out to be incompatible with a critical dependency, or poorly maintained from a security perspective, often costs more time and risk than the size savings were worth.

Content in this section