747 words
4 minutes

13 from Docker Hardened Images Migration: A Healthy Database That Kept Nothing

The hardened image move: a stack moves once every stateful service survives a recreate

By Docker Captain · CNCF Ambassador · IBM Champion
Armoured drum, empty glass cylinder, unplugged hose, Docker Hardened Images

A hardened image is smaller because it takes things away: a shell, a package manager, the tools a health check called, the user ID a compose file pinned, the directory a volume was mounted on.

The move is safe once each of those is checked on purpose, in a test that has seen the old setting fail, and once the release gate knows which scanner it reads.

  1. 1

    Write, recreate and read every stateful service

    On the new image, write a row, count the files on the volume, recreate the container, and read the row back. A healthy database proves nothing about where it writes; the trap test shows the quiet version.

  2. 2

    Mount where the new image keeps its data

    Read the image's guide for its data path. The hardened PostgreSQL keeps its cluster in a directory named after the major version, and Docker's guide says a new install mounts the parent. An install moved from the official image mounts the versioned directory, so its cluster is read where it is.

  3. 3

    Keep a read-only root filesystem wherever it runs

    In this stack it turned a silent data loss into an error at the first start.

  4. 4

    Check every user ID against every pin and every volume

    The hardened PostgreSQL runs as user 70 and the hardened Keycloak's files belong to 65532. Every pinned user in the compose file and the owner of every volume that already holds data are checked before the move.

  5. 5

    Run every health check's command inside the new image

    If the tool is not in the image (wget, grep, a shell loop), the check is already broken. Use the service's own health command or shell builtins.

  6. 6

    Move an install with data in three steps

    Stop the stack, its volumes stay. Hand the database volume to the new user once, with a script that refuses while anything uses the volume. Start with the override.

  7. 7

    Decide the scanner before the first hardened digest

    Write down which scanner the release gate reads and whether it trusts the vendor's vulnerability statements. Owner: whoever owns the release gate.

  8. 8

    Give every puller credentials, and name who moves the pins

    The hardened registry refuses anonymous pulls: every host, runner, mirror and bot needs a login. A pin nobody moves keeps last month's image under this month's findings.

Two scanners, one set of pinned images, 9 November 2026: Trivy without vendor statements, Scout with Docker's VEX

ImageOfficial, TrivyHardened, TrivyOfficial, ScoutHardened, Scout
PostgreSQL2 critical, 93 high1 critical, 16 high4 critical, 35 high0 critical, 2 high
Keycloak0 critical, 7 high0 critical, 4 high1 critical, 14 high0 critical, 1 high
Traefik0 critical, 2 high0 critical, 0 high2 critical, 5 high1 critical, 4 high

What shows it works

The runs and the test behind each step.

The image took away what an attacker could use and what the compose file relied on.

The long version is the post Docker Hardened Images Migration. Docker, the guide to the hardened PostgreSQL image, checked 12 November 2026; Docker, Docker makes hardened images free, open and transparent for everyone, 17 December 2025.


Vladimir Mikhalev

Docker CaptainCNCF AmbassadorIBM Champion

The Verdict — production-tested analysis on YouTube.

The Verdict

Inconvenient truths about shipping in the AI era

Container security, platform engineering, and the agentic shift — tested in production, argued without the hype. The verdict reaches your inbox the moment there's one worth sending.

Related Posts

Same category
  1. 1
    Docker Hardened Images Migration: A Healthy Database That Kept Nothing
    DevOps & Cloud · Moving a Compose stack to Docker Hardened Images changes user IDs, paths and tools. On the old mount path, PostgreSQL stayed healthy and kept nothing.
  2. 2
    EKS Validation on a Real AWS Account: Seven Failures No Mock Saw
    DevOps & Cloud · Proving an EKS platform on a real AWS account: twenty cents a run by estimate, about fifty on the bill, and seven failures no mocked test or kind saw.
  3. 3
    A Partial Read Is Not a Smaller Fleet: A GitHub API Rate Limit and the Numbers That Lied for an Hour
    DevOps & Cloud · A partial read published as the whole. For an hour the profile said 24 restore scripts across 15 repositories, and the fleet had 73 across 48. Three guards now.
  4. 4
    Restore Drills on a Clean Machine — Measured RTO for 47 Stacks, 19 Seconds to 7 Minutes
    DevOps & Cloud · Restore drills that measure RTO on a machine that never ran the stack, 47 templates weekly. Every same-host restore passed. The first clean one answered 500.

More Blueprints

All 15
  1. 14
    The boundary gate
    Signal, 18 October 2026 · Put every tool behind a schema-checking server, score the release from the services with two zeros and a control, and set the usefulness floor from runs on each runner.
  2. 15
    The landing order
    Signal, 10 July 2025 · One worktree per agent, a landing order with an owner, a cap on diff width, commits shaped before review, and two numbers that show the merge debt.
  3. 01
    The blast radius assessment
    Signal, 23 February 2026 · Map what an AI agent can break, and how fast a person can undo it, before it gets a single key: six steps, a worksheet and the repositories that measure the same rules.
  4. 02
    The AI intake gate
    Signal, 12 March 2026 · Find every AI tool in use, ask for its backend's access rules instead of a questionnaire, and block what cannot use SSO and central logging, before the first prompt.
The hardened image move: a stack moves once every stateful service survives a recreate
https://heyvaldemar.com/blueprints/hardened-image-move/
Author
Vladimir Mikhalev
Published
2026-11-15
License
CC BY-NC-SA 4.0