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 Blueprint 13

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
    DNS Exfiltration From an Air-Gapped VPC: No Route Out Is Not No Way Out
    DevOps & Cloud · DNS exfiltration needs no route. In a VPC with no internet gateway and no NAT, a pod and its node still resolved example.com, until a DNS Firewall refused it.
  3. 3
    Scheduled Workflows Fail Silently: A GitHub Actions Heartbeat for 122 Repositories
    DevOps & Cloud · GitHub Actions switches off a scheduled workflow after 60 quiet days, with no failed run and no red badge. What watches every schedule, and the watcher.
  4. 4
    Completed Is Not Restored: Kyverno Fail-Open, a Velero Restore and an HTTP 200 That Meant 500
    DevOps & Cloud · Scale Kyverno to zero and its webhooks vanish. A Velero restore said Completed over an empty disk. A 200 carried a 500. Three statuses that reported success.

More Blueprints

All 20
  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 and the shared index measured on your runners, a landing order with an owner, a cap on diff width, commits shaped before review, and two numbers that show the merge debt.
  3. 16
    Sign before the names
    Signal, 26 September 2026 · List every tag each trigger emits against the registry's immutability rule, push by digest, sign and check that digest, move the names last, and judge a publish by its signature.
  4. 17
    The effect check
    Signal, 21 October 2026 · List what only a webhook enforces and move it into the API server, make the checker's absence a refusal, drill admission with its controller at zero, count what each backup copied, read the marker and the error body, and run the reads on a schedule.
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