Skip to main content
Cloud DevOps Solutions
Get a quote Talk to an engineer

Docker & Containerization

Docker Base Image Standardisation: Golden Images and a Patch Strategy

Base image standardisation means your teams build from a small set of approved, maintained images instead of whatever each developer picked. We define that set, pin versions, automate update pull requests and set a rebuild cadence so security patches reach every service without manual chasing.

Key takeaways

  • Dozens of different base images multiply patching work and scanner findings.
  • A short approved list per language is easier to secure, test and support.
  • Pinning gives reproducibility, and automation keeps pins from going stale.
  • Patches only help once services are rebuilt and redeployed, so the process must cover rebuilds.
  • A golden image should be thin: too much customisation becomes a product you must maintain.

The problem with every team choosing their own

Open ten repositories and you will often find eight base images. One service is on an old Ubuntu release, another on Alpine, a third on a language image from three years ago, and a fourth that pulls latest. Each choice made sense once. Together they mean a critical OpenSSL advisory becomes eight separate investigations, scanner output is a wall of noise, and nobody can say how many services are affected.

Standardising the starting point is among the cheapest security and maintenance wins in containerisation. It sits within our Docker containerisation service and supports managed DevOps engagements where we maintain the pipeline long term.

What good looks like

  • A written list of approved base images per language and purpose (build, runtime, debug).
  • Each image has an owner and a reason it is on the list.
  • Versions are pinned, and updates arrive as reviewed pull requests.
  • Images are mirrored into your own registry, so builds do not depend on public rate limits.
  • Services are rebuilt on a schedule, not only when a developer touches them.
  • Anything outside the list is possible, but visible.

Choosing what goes on the list

PurposeCommon choiceReason
General runtimeDebian slim variant of the language imageCompatible, well patched, familiar
Static or Go servicesDistroless static or scratchMinimal attack surface
JVM servicesDistroless Java or a Temurin runtime imageMatches your Java version policy
Build stagesFull language image with toolchainNever shipped, so size does not matter
DebuggingA debug variant with a shellUsed by engineers, not deployed by default

Smaller vendor-maintained minimal image families, such as those built around Wolfi, are also worth evaluating if you want very frequent patching with a minimal footprint. We do not push a particular vendor. We compare the options against your languages, support needs and licensing.

The trade-offs between Alpine, slim and distroless are covered in more depth in Dockerfile multi-stage builds.

Pinning and automated updates

A reasonable policy is: Dockerfiles reference a specific version tag, and a bot keeps it fresh. Renovate can also pin digests and open pull requests when either the tag or the digest moves. A starting configuration looks like this:

{
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended", "docker:pinDigests"],
  "packageRules": [
    {
      "matchDatasources": ["docker"],
      "matchUpdateTypes": ["minor", "patch", "digest"],
      "automerge": true,
      "automergeType": "pr",
      "platformAutomerge": true
    },
    {
      "matchDatasources": ["docker"],
      "matchUpdateTypes": ["major"],
      "automerge": false
    }
  ]
}

Automerge is only safe where CI is strong. If your tests are thin, leave automerge off and review the pull requests. The Dockerfile result looks like:

FROM node:22-bookworm-slim@sha256:<digest-managed-by-renovate> AS runtime

The digest is maintained by the tool, so a human never types it.

Rebuilds are the real patching mechanism

A patched base image fixes nothing until a service is rebuilt and redeployed on top of it. Many teams forget this: the base is updated upstream in March, and a service that nobody has changed since January keeps running the old one. We handle this in two ways:

  1. Scheduled rebuilds. A weekly pipeline rebuilds and redeploys through the normal promotion path, so patches land without a code change.
  2. Urgent path. When a critical vulnerability appears, a documented procedure lists affected services from scanner results and triggers rebuilds in priority order.

Mirroring and supply chain

Pulling directly from a public registry in CI creates two risks: rate limits that break builds, and no control over what changed upstream. We mirror approved images into your private registry, scan them there, and point Dockerfiles at the mirror. For extra assurance, the mirrored image can be signed so that clusters only admit images that went through this path.

Decisions and trade-offs

Build your own golden image or use upstream? Keep any custom layer thin. The more you add, the more you must patch and test. If the only difference is a CA bundle, handle it in the Dockerfile template instead.

Strict enforcement or guidance? For regulated environments, enforce with an admission policy that rejects unapproved registries. For fast-moving product teams, begin with CI warnings and tighten later.

One image for all languages? No. A per-language list is more useful than a generic base.

Common failure modes

  • Automerge without tests breaking runtime behaviour after a minor distribution change.
  • Digest pins with no updater, leaving old images forever.
  • Golden images that grow into undocumented platforms.
  • Forgotten long-tail services that never rebuild. We track image age as a metric.

A worked example: one advisory, two estates

Suppose a critical vulnerability is published in a widely used system library. In an estate with no standard, someone must search every repository for FROM lines, guess which images include the library, and ask each team whether they can rebuild this week. The answer takes days and is never complete.

In a standardised estate, the question is mechanical. The approved images are few, so you check whether the affected library is in them. Your registry knows which services were built on which base digest, so the affected list is a query rather than a survey. Renovate has usually already opened the update pull request, so the work is reviewing, merging and letting the rebuild pipeline roll it out. That difference in response time is the real return on standardisation, and it is hard to see until the first serious advisory arrives.

What we ask you to decide before we start

Standards only stick when someone owns them. Before the engagement begins we ask for three decisions: who approves additions to the list, how long a team may stay on an unapproved image before it must migrate, and who is on call for urgent rebuilds. Without these, the approved list slowly turns back into a suggestion. If you have no platform team yet, we can hold these roles temporarily under managed DevOps and hand them over once someone is hired.

Handling exceptions

Some workloads genuinely need something different: a machine learning image with GPU drivers, a legacy application pinned to an old runtime, or a vendor-supplied image you cannot modify. We record these in an exceptions register with an owner, a reason and a review date. Exceptions are fine. Invisible exceptions are the problem.

Delivery and handover

We deliver the approved list, the Renovate configuration, the rebuild schedule, the urgent patch runbook, and documentation in the Dockerfile standards guide.

How to tell it is working

The number of distinct base images falls and stays low, median image age is measured in weeks rather than months, scanner findings stop spiking from old services, and a major advisory is answered with a list and a plan within hours. To review your estate, book a consultation.

References

How we deliver it

  1. 01

    Inventory what runs

    We list every base image and tag in use across repositories and registries, with age and scanner results.

  2. 02

    Define the approved set

    A short list of runtime and build images per language, with the reasons for each choice.

  3. 03

    Decide how to pin

    We set the rule for tags and digests, and for where the approved images are mirrored.

  4. 04

    Automate updates

    Renovate or Dependabot opens pull requests for new versions and digests, tested by CI before merge.

  5. 05

    Set rebuild and rollout cadence

    Scheduled rebuilds and a rule for urgent patches ensure fixes reach running workloads.

  6. 06

    Publish and enforce

    Standards are documented, and a CI check or admission policy flags images outside the approved list.

Tools and technologies

RenovateDependabotDockerAmazon ECRAzure Container RegistryTrivydistrolessDebian slimAlpine LinuxWolfiGitHub ActionsKyverno

Frequently asked questions

What is a golden image?
A golden image is a vetted base image that teams are expected to build from. It might add your CA certificates, a non-root user, a timezone setting and standard labels on top of an upstream image. It gives every service the same secure starting point and one place to apply fixes.
Should we pin base images by digest?
Digest pinning gives exact reproducibility: the same Dockerfile always builds on the same bytes. The cost is that nobody gets security patches unless the digest is updated. Pin by digest only if an automated tool proposes updates, otherwise a pinned digest becomes a stale one.
How often should base images be updated?
Rebuild routinely, often weekly, and immediately for critical vulnerabilities that affect you. The cadence matters less than having one. Regular small updates are easier than occasional big ones, and they keep your scanner results stable.
Why not just use latest?
The latest tag changes without notice, so builds are not reproducible and an upstream change can break production on the next rebuild. Pin to a specific version instead and update it deliberately through a tested pull request.
Do we need our own base images or can we use upstream ones directly?
Upstream official images are fine for many teams. Build your own thin layer when you need shared certificates, a standard user, internal tooling or a mirror for rate-limit and supply-chain control. Avoid heavy custom images, since you then own their patching forever.

Talk to an engineer about docker base image strategy

Book a free 30-minute call. We review your current setup and tell you honestly whether and how we can help.

Written by Saddique Khan, DevOps / SRE / Cloud Consultant Engineer. Last updated 2026-10-08.