DevOps engineer reviewing Docker container image IDs and named-volume files during an application update

Why a New Docker Container Still Reads Old Named-Volume Files

Thu, Nov 26, 2026

A container can be replaced successfully, report the expected new image ID, and still read files that came from the previous revision. With a Docker named volume, that combination is not contradictory. Docker documents two separate behaviors that matter here: when an empty volume is mounted over a container directory that already contains data, Docker copies that data into the volume by default; when a nonempty volume is mounted there later, the volume obscures the image’s files at that path. volume-nocopy suppresses the first behavior for an empty volume.

The release question therefore cannot be reduced to “Did the new tag start?” or even “Does the container have the new image ID?” The qualification object is the actual image ID, the lineage of the named volume mounted into that container, and the complete files the application can read there, compared against a contract declared independently of the run.

This article defines a proposed ten-case laboratory for that qualification. It uses two synthetic image revisions, an isolated and owned local Linux/amd64 Docker daemon, the local volume driver, explicit Docker CLI commands, and tiny text fixtures. It excludes bind mounts, Compose, Kubernetes, anonymous volumes, remote daemons, Docker Desktop, plugin or network storage, concurrent writers, automatic entrypoint initialization, production data, build-cache experiments and database-recovery claims.

Research date: November 26, 2026. No pull, build, Docker execution, runtime image-ID collection, volume creation or runtime digest resolution occurred during this research. Every V01–V10 result below is EXPECTED / NOT EXECUTED. The article’s overall release status is therefore HOLD. The documented Docker rules motivate the expectations; they do not turn an unexecuted command sequence into evidence.

Docker Engine 28.5.2 is used only as a historical qualification baseline. Docker’s release notes date 28.5.2 to November 5, 2025 and record BuildKit v0.25.2 in that release. It is not described here as the current Engine release, nor is this article recommending that a production environment be downgraded to it. An actual run must record the client, daemon and builder versions that really participated.

Define the image-and-volume acceptance contract

This is not another bind-mount troubleshooting exercise. Refonte Learning already covers diagnosing files hidden by Docker bind mounts. The present problem begins after bind-source questions have been excluded: the mount source is a Docker-managed named volume, and the investigation asks whether replacing an application container also replaced the files visible under /srv/state.

Docker documents that a nonempty volume mounted over a directory hides the directory’s pre-existing container files, while an empty volume receives those pre-existing files by default unless volume-nocopy is requested. Docker also treats volume removal as a separate operation from stopping or removing a container, so preserving a named volume across consumer replacement is an ordinary lifecycle possibility rather than evidence that Docker ignored a new image.

The synthetic contracts are deliberately small:

Contract

Exact required files and bytes

Forbidden

Image A baseline

seed.txt = seed=A\n; legacy.txt = legacy=A\n

new.txt, state.txt, keep.txt, extras

Image B baseline

seed.txt = seed=B\n; new.txt = new=B\n

legacy.txt, state.txt, keep.txt, extras

A-plus-state

A baseline plus state.txt = counter=7\n

new.txt, keep.txt, extras

B-plus-state release contract

B baseline plus state.txt = counter=7\n

legacy.txt, keep.txt, extras

Unrelated control

keep.txt = keep=unrelated\n

every seed/state file

“Exact” matters. Matching only state.txt is not enough. Matching only filenames is not enough. A B container that sees seed=A\n, legacy=A\n and counter=7\n is a useful lifecycle observation but not an acceptable B-plus-state deployment.

Declare independent manifests before execution

The expected manifests must exist before any Docker case is run. They should be generated from the controlled fixture sources, not reconstructed afterward from whatever the volume happened to contain.

The following host-side setup is proposed and NOT EXECUTED. Its owned boundary is a newly created $LAB directory. It refuses to continue if that directory already exists.

set -euo pipefail

LAB="${HOME}/rl-named-volume-lab-20261126"
case "$LAB" in
  "$HOME"/rl-named-volume-lab-20261126) ;;
  ) printf 'Refusing unexpected LAB path: %s\n' "$LAB" >&2; exit 64 ;;
esac
[ ! -e "$LAB" ] || { echo "LAB already exists; choose a fresh owned workspace" >&2; exit 65; }

mkdir -p "$LAB"/{A/payload,B/payload,oracle,evidence}

printf 'seed=A\n' >"$LAB/A/payload/seed.txt"
printf 'legacy=A\n' >"$LAB/A/payload/legacy.txt"

printf 'seed=B\n' >"$LAB/B/payload/seed.txt"
printf 'new=B\n' >"$LAB/B/payload/new.txt"

mkdir -p "$LAB/oracle"/{A,A-state,B,B-state,unrelated}
cp "$LAB/A/payload/" "$LAB/oracle/A/"
cp "$LAB/A/payload/"* "$LAB/oracle/A-state/"
printf 'counter=7\n' >"$LAB/oracle/A-state/state.txt"

cp "$LAB/B/payload/"* "$LAB/oracle/B/"
cp "$LAB/B/payload/"* "$LAB/oracle/B-state/"
printf 'counter=7\n' >"$LAB/oracle/B-state/state.txt"

printf 'keep=unrelated\n' >"$LAB/oracle/unrelated/keep.txt"

These bytes are declarations, not measurements. A later observer must enumerate the entire subject tree, reject unexpected object types, and capture complete file bytes or equivalently compare every byte against these independent sources.

Fix the laboratory boundary and evidence format

The daemon must be an isolated Docker Engine that the experiment owner controls, using local named volumes and Linux/amd64. Record the Docker context, daemon information and versions before changing anything. docker inspect can explicitly select an object type, which matters because a container, volume or another Docker object can share a name; the generic command otherwise resolves names across supported object types.

Volume metadata is useful but should not be overinterpreted. Docker’s docker volume inspect example exposes fields including CreatedAt, Driver, Labels, Mountpoint, Name, Options and Scope. That metadata does not constitute a universal immutable UUID for the volume, and it does not prove what files are inside.

The experimental naming boundary is fixed:

set -euo pipefail
: "${LAB:=${HOME}/rl-named-volume-lab-20261126}"
EVIDENCE="$LAB/evidence"
[ -d "$EVIDENCE" ] || { echo "Missing owned evidence directory" >&2; exit 66; }

docker context show >"$EVIDENCE/context.txt" 2>"$EVIDENCE/context.stderr"
docker context inspect >"$EVIDENCE/context-inspect.json" 2>"$EVIDENCE/context-inspect.stderr"
docker version >"$EVIDENCE/docker-version.txt" 2>"$EVIDENCE/docker-version.stderr"
docker info >"$EVIDENCE/docker-info.txt" 2>"$EVIDENCE/docker-info.stderr"
docker buildx version >"$EVIDENCE/buildx-version.txt" 2>"$EVIDENCE/buildx-version.stderr"

printf '%s\n' \
  rlv-v03-init \
  rlv-v04-original \
  rlv-v05-fresh-b \
  rlv-v06-nocopy-empty \
  rlv-v07-unrelated \
  rlv-v08-a-state \
  rlv-v09-candidate \
  >"$EVIDENCE/owned-volumes.txt"

Do not accept a remote TCP endpoint, an unexpected context, a non-Linux daemon or a different architecture as if it were the declared laboratory. Those conditions are environment changes and drive RERUN, not silent normalization.

Capture the runtime source separately from the requested source

Requested tags and actual runtime identity are different evidence. For every subject container, preserve the create command, its stdout, stderr and exit code; then preserve docker inspect --type=container before and after starting it. The inspect record must include .Image, .Config.Image, .State and .Mounts.

That distinction is essential to the eventual diagnosis. rl-volume-lab:b in a create command says what was requested. The container’s .Image field is the image ID Docker associated with the created container. The visible files are a third fact. None should be substituted for another.

If documentation predicts one result and an actual supported runtime produces another, do not rewrite the expected ledger to make it pass. Capture the exact versions, invocation, object inspections, stdout, stderr, exits and manifests, then classify the discrepancy as HOLD_EVIDENCE or RERUN until it is explained.

Build and verify the two seed revisions

The BusyBox Official Image catalog checked on November 26, 2026 lists busybox:1.37.0 and includes amd64 among supported architectures. The tag listing alone is not treated as the approved laboratory digest. An immutable Linux/amd64 digest must be independently resolved and approved before execution. No digest was resolved for this article.

Both revisions use basic COPY; Docker documents that COPY adds files or directories from the build context to the destination in the image. No optional recent COPY flags are required here. For build-context filtering, see Refonte Learning’s separate treatment of Dockerfile-specific ignore precedence.

The proposed Dockerfile is identical in A and B:

ARG BASE_REF
FROM ${BASE_REF}
COPY payload/ /srv/state/

Before a future build, set BASE_DIGEST to the reviewed immutable Linux/amd64 digest. The placeholder below is intentionally non-runnable until that approval exists.

set -euo pipefail
: "${LAB:=${HOME}/rl-named-volume-lab-20261126}"
: "${BASE_DIGEST:?Set an independently approved immutable linux/amd64 BusyBox digest first}"

BASE_REF="busybox@${BASE_DIGEST}"
cp "$LAB/Dockerfile" "$LAB/A/Dockerfile" 2>/dev/null || true
cp "$LAB/Dockerfile" "$LAB/B/Dockerfile" 2>/dev/null || true

for d in A B; do
  [ -f "$LAB/$d/Dockerfile" ] || {
    echo "Missing Dockerfile for $d" >&2
    exit 67
  }
done

docker build --platform=linux/amd64 \
  --build-arg "BASE_REF=$BASE_REF" \
  -t rl-volume-lab:a "$LAB/A"

docker build --platform=linux/amd64 \
  --build-arg "BASE_REF=$BASE_REF" \
  -t rl-volume-lab:b "$LAB/B"

IMG_A_ID="$(docker image inspect --format '{{.Id}}' rl-volume-lab:a)"
IMG_B_ID="$(docker image inspect --format '{{.Id}}' rl-volume-lab:b)"
[ "$IMG_A_ID" != "$IMG_B_ID" ] || {
  echo "A and B unexpectedly resolved to one image ID" >&2
  exit 68
}
printf '%s\n' "$IMG_A_ID" >"$LAB/evidence/image-a.id"
printf '%s\n' "$IMG_B_ID" >"$LAB/evidence/image-b.id"

The || true around the two cp operations is not intended as production error handling; it permits only the explicitly anticipated case in which the shared Dockerfile has already been copied during fixture preparation. The immediately following existence checks are the required gate. A cleaner implementation would create both Dockerfiles in the initial fixture script and omit that branch entirely.

V01 and V02 then verify the images without any volume mounted. Each container is created using the saved immutable local image ID, inspected, started with a read-only probe command and compared with the independent A or B oracle. These two baselines prevent a later named-volume discrepancy from being confused with an unverified build artifact.

set -euo pipefail
: "${IMG_A_ID:?Missing A image ID}"
: "${IMG_B_ID:?Missing B image ID}"

docker create --name rlv-v01-a "$IMG_A_ID" \
  sh -eu -c 'find /srv/state -mindepth 1 -maxdepth 1 -type f -print | sort; cat /srv/state/seed.txt /srv/state/legacy.txt'

docker inspect --type=container rlv-v01-a >"$LAB/evidence/V01.inspect.json"
docker start -a rlv-v01-a >"$LAB/evidence/V01.stdout" 2>"$LAB/evidence/V01.stderr"

docker create --name rlv-v02-b "$IMG_B_ID" \
  sh -eu -c 'find /srv/state -mindepth 1 -maxdepth 1 -type f -print | sort; cat /srv/state/seed.txt /srv/state/new.txt'

docker inspect --type=container rlv-v02-b >"$LAB/evidence/V02.inspect.json"
docker start -a rlv-v02-b >"$LAB/evidence/V02.stdout" 2>"$LAB/evidence/V02.stderr"

Expected V01 is exactly A. Expected V02 is exactly B. Their eventual ACCEPT status is a baseline-control result, not approval of any stateful replacement.

Prove first population during container creation

V03 isolates the most important timing question: does initial named-volume population require the application to start?

Docker’s docker container create documentation states that a container is created without starting and that container volumes are initialized during the create phase. Combined with the volume documentation’s empty-volume propagation rule, this motivates a created-but-never-started control.

Create the named volume explicitly with the local driver, record its metadata while it is empty, then create an A container mounting it at /srv/state. Do not start that subject container.

set -euo pipefail
: "${IMG_A_ID:?Missing A image ID}"

V03=rlv-v03-init
docker volume create --driver local --label rl.lab=20261126 "$V03" \
  >"$LAB/evidence/V03.volume-create.stdout" \
  2>"$LAB/evidence/V03.volume-create.stderr"

docker volume inspect "$V03" >"$LAB/evidence/V03.volume-before.json"

docker create --name rlv-v03-created \
  --mount type=volume,src="$V03",dst=/srv/state \
  "$IMG_A_ID" true \
  >"$LAB/evidence/V03.create.stdout" \
  2>"$LAB/evidence/V03.create.stderr"

docker inspect --type=container rlv-v03-created >"$LAB/evidence/V03.container.json"

The expected state of rlv-v03-created is created, not running or exited. The expected volume content after this create is A’s two files. That expectation is a deduction from the documented create-phase initialization and empty-volume propagation rules; it remains NOT EXECUTED.

Observe creation without allowing the observer to populate

The observer must not itself explain the bytes being investigated. Therefore its mount target is /mnt/subject, not /srv/state, and every observer uses volume-nocopy. For content-only probes it is also mounted read-only.

A read-only mount limits writes by that particular mounted consumer. Docker explicitly permits the same volume to be mounted read-write by one container and read-only by another, so readonly is not a global lock against every possible writer. The laboratory excludes concurrent writers and owns every container that can mount the volumes.

A proposed observer pattern is:

set -euo pipefail
: "${IMG_A_ID:?Missing observer image ID}"
: "${V03:?Missing volume name}"

docker create --name rlv-v03-observer \
  --mount type=volume,src="$V03",dst=/mnt/subject,readonly,volume-nocopy \
  "$IMG_A_ID" sh -eu -c '
    find /mnt/subject -mindepth 1 -maxdepth 1 -print | sort > /tmp/list
    while IFS= read -r p; do
      [ -f "$p" ] && [ ! -L "$p" ] || { echo "NONREGULAR:$p" >&2; exit 42; }
      printf "FILE:%s\n" "${p#/mnt/subject/}"
      od -An -v -tx1 "$p" | tr -d " \n"
      printf "\n"
    done < /tmp/list
  '

docker inspect --type=container rlv-v03-observer >"$LAB/evidence/V03.observer.inspect.json"
docker start -a rlv-v03-observer \
  >"$LAB/evidence/V03.manifest.txt" \
  2>"$LAB/evidence/V03.observer.stderr"

That output is designed to contain the complete bytes in hexadecimal rather than only plausible-looking filenames. A verifier can compare it with an independently generated oracle. The expected V03 result is A’s exact manifest even though the A subject was never started.

Observe named-volume reuse before changing anything

Before V04, establish the operational interpretation of reuse. A volume name is a selector, not sufficient proof by itself that a later object is the same state lineage intended by the experiment. For every volume, preserve its initial docker volume inspect, labels, creation time exposed by the daemon, driver, scope and every preparation action. Docker’s volume-inspect documentation shows those fields as metadata about a volume configuration; the content probe remains a separate evidence layer.

The release ledger therefore records three identities separately: the subject container’s actual .Image; the exact named volume selected in .Mounts; and the preparation history that led to its current contents. Where the platform exposes a mountpoint, retain it as supporting metadata, but do not build a portable identity scheme around an implementation path.

This separation answers the recurring “Docker volume not updating” complaint more accurately. If an A-populated named volume is later reused by B, B’s new image can be real at the same time that A’s older seed files remain visible. Docker documents that a nonempty mounted volume obscures pre-existing container data at the destination. The relevant release question is whether that image-and-volume combination satisfies the declared contract.

Replace the container and retain the original volume

V04 constructs the original stateful lineage. Create rlv-v04-original as a fresh local volume, populate it from A, then add only state.txt through a controlled helper. The expected A-plus-state tree is:

legacy.txt  -> legacy=A\n
seed.txt    -> seed=A\n
state.txt   -> counter=7\n

After independently observing that manifest, remove the A consumer but not the volume. Then create B against the same nonempty volume.

set -euo pipefail
: "${IMG_A_ID:?}"
: "${IMG_B_ID:?}"

V04=rlv-v04-original
docker volume create --driver local --label rl.lab=20261126 "$V04"
docker volume inspect "$V04" >"$LAB/evidence/V04.volume.created.json"

docker create --name rlv-v04-a \
  --mount type=volume,src="$V04",dst=/srv/state \
  "$IMG_A_ID" true
docker inspect --type=container rlv-v04-a >"$LAB/evidence/V04.a.inspect.json"

docker create --name rlv-v04-state-helper \
  --mount type=volume,src="$V04",dst=/mnt/subject,volume-nocopy \
  "$IMG_A_ID" \
  sh -eu -c 'printf "counter=7\n" > /mnt/subject/state.txt'
docker start -a rlv-v04-state-helper

docker rm rlv-v04-state-helper
docker rm rlv-v04-a

docker create --name rlv-v04-b \
  --mount type=volume,src="$V04",dst=/srv/state \
  "$IMG_B_ID" true
docker inspect --type=container rlv-v04-b >"$LAB/evidence/V04.b.inspect.json"

Expected B runtime identity plus A-plus-state contents is exactly the distinction being tested. new.txt remains absent because the volume is already nonempty; B’s /srv/state image contents are obscured by the mounted volume. This is where validating Docker build artifacts after secret rotation is a useful contrast: that article asks whether the built artifact itself is stale. Here V02 has already established the B image baseline; V04 instead investigates a verified B image reading retained volume data.

The expected deployment disposition is REPAIR_ALIGNMENT, not “Docker defect.” Image and persistent state are individually explainable but do not form the approved B-plus-state combination.

Record container removal without deleting the volume

Before and after removing rlv-v04-a, capture docker volume inspect "$V04" and the complete read-only manifest. Do the same before and after creating rlv-v04-b. The probe must not write.

V04 is intentionally a cross-case dependency. Do not remove, recreate, rename or reinitialize rlv-v04-original. Preserve it for V09 migration and V10 restoration. A matching volume name created later is not accepted as equivalent merely because the string is the same.

The critical preservation assertion is:

V04 manifest after A population + approved state == V04 manifest after A removal == V04 manifest after B creation == V04 manifest after V09 migration helper completes.

That assertion remains expected until measured.

Compare a new volume with a complete state migration

V05 supplies the contrast between “fresh B files” and “successful stateful replacement.” Create a separate verified-empty volume and attach B with default population. Docker documents that an empty volume receives files already present at the container mount destination by default.

set -euo pipefail
: "${IMG_B_ID:?}"

V05=rlv-v05-fresh-b
docker volume create --driver local --label rl.lab=20261126 "$V05"
docker volume inspect "$V05" >"$LAB/evidence/V05.volume.created.json"

docker create --name rlv-v05-b \
  --mount type=volume,src="$V05",dst=/srv/state \
  "$IMG_B_ID" true

docker inspect --type=container rlv-v05-b >"$LAB/evidence/V05.container.json"

Expected contents are exactly seed.txt=seed=B\n and new.txt=new=B\n. legacy.txt and state.txt are absent.

That result would demonstrate correct B seeding, but it does not satisfy this application owner’s B-plus-state contract. The release decision is HOLD_STATE, because required counter=7 state is missing.

Deleting the original V04 volume and treating V05 as the “upgrade” would destroy both required state and the strongest comparison evidence. That is explicitly prohibited. A genuinely stateless application might have a different contract in which fresh B seed alone is acceptable, but this fixture is intentionally stateful; changing the contract to make the test pass is not a migration.

Test empty and unrelated-content volumes

V06 isolates Docker volume-nocopy on an empty volume. Create the volume explicitly and prove its emptiness without introducing a sentinel file. Then create B with volume-nocopy.

Docker documents volume-nocopy as disabling the default copy of destination data into an empty volume.

set -euo pipefail
: "${IMG_B_ID:?}"

V06=rlv-v06-nocopy-empty
docker volume create --driver local --label rl.lab=20261126 "$V06"

docker create --name rlv-v06-b \
  --mount type=volume,src="$V06",dst=/srv/state,volume-nocopy \
  "$IMG_B_ID" true

docker inspect --type=container rlv-v06-b >"$LAB/evidence/V06.container.json"

The expected observed tree is empty. That is not evidence that B lacks its seed files; V02 established those files in the image. It is evidence, if observed, that the empty volume did not receive them under the requested no-copy mount. Deployment disposition: HOLD_SEED.

V07 answers a subtly different question: what if a volume contains one unrelated file, but none of the filenames present in B?

Prepare a distinct volume using a helper mounted with volume-nocopy, write only keep.txt=keep=unrelated\n, and verify that complete precondition. Then attach B with default behavior.

set -euo pipefail
: "${IMG_A_ID:?}"
: "${IMG_B_ID:?}"

V07=rlv-v07-unrelated
docker volume create --driver local --label rl.lab=20261126 "$V07"

docker create --name rlv-v07-prep \
  --mount type=volume,src="$V07",dst=/mnt/subject,volume-nocopy \
  "$IMG_A_ID" \
  sh -eu -c 'printf "keep=unrelated\n" > /mnt/subject/keep.txt'
docker start -a rlv-v07-prep
docker rm rlv-v07-prep

docker create --name rlv-v07-b \
  --mount type=volume,src="$V07",dst=/srv/state \
  "$IMG_B_ID" true

docker inspect --type=container rlv-v07-b >"$LAB/evidence/V07.container.json"

The expected result is only keep.txt. A volume does not become “empty for population purposes” merely because it lacks B’s expected filenames. Docker’s documented distinction is empty versus nonempty, not “contains a matching seed name versus does not.” V07 therefore expects HOLD_SEED.

V06 and V07 must have independent precondition evidence. Do not prove V06 emptiness by writing a marker into it, and do not infer V07 nonemptiness solely from the helper’s zero exit; inspect the volume content afterward.

Apply volume-nocopy to an already populated volume

V08 uses another independently prepared A-plus-state volume. It must not reuse V04, because V04 is reserved unchanged for V09 and V10. Populate V08 from A, add counter=7, verify A-plus-state, then create B with volume-nocopy.

The expected tree before and after is the same A-plus-state tree. volume-nocopy suppresses copying into an empty volume; it is not an instruction to empty an existing volume or overwrite it with B.

Record the exact requested mount option in the command ledger and preserve the raw container inspect. Depending on Engine/API serialization, a reviewer may or may not see every requested option represented where expected. Absence of one optional serialized field is not by itself proof that no-copy behavior did or did not occur. The decisive evidence remains the independently established precondition plus complete before/after content comparison.

Expected disposition: REPAIR_ALIGNMENT. B is the approved image revision, but the mounted tree still represents A-plus-state rather than B-plus-state.

Assemble the replacement without altering the original

V09 is the actual replacement candidate. It creates its own volume, establishes its own creation evidence and receives B’s seed before any state migration. It must not silently reuse V05.

Keep application consumers stopped during preparation. A convenient control is to use docker create to let B populate the replacement without starting the B application command; Docker documents volume initialization in the create phase.

set -euo pipefail
: "${IMG_B_ID:?}"

V09=rlv-v09-candidate
docker volume create --driver local --label rl.lab=20261126 "$V09"
docker volume inspect "$V09" >"$LAB/evidence/V09.volume.created.json"

docker create --name rlv-v09-seed \
  --mount type=volume,src="$V09",dst=/srv/state \
  "$IMG_B_ID" true

docker inspect --type=container rlv-v09-seed >"$LAB/evidence/V09.seed-container.json"

Before migration, an observer must establish the exact B baseline: seed.txt=seed=B\n, new.txt=new=B\n, no state.txt, no legacy.txt, no extra objects. If that prerequisite fails, V09 is HOLD rather than an invitation to copy state into a questionable destination.

Copy only the state approved by the application owner

The migration helper mounts V04 read-only and V09 writable. Both mounts use volume-nocopy so the helper cannot seed either mount target from its own image. The source type and bytes are checked before copying.

set -euo pipefail
: "${IMG_A_ID:?}"
V04=rlv-v04-original
V09=rlv-v09-candidate

docker create --name rlv-v09-migrate \
  --mount type=volume,src="$V04",dst=/src,readonly,volume-nocopy \
  --mount type=volume,src="$V09",dst=/dst,volume-nocopy \
  "$IMG_A_ID" sh -eu -c '
    [ -f /src/state.txt ] && [ ! -L /src/state.txt ] || {
      echo "state.txt is missing or not a regular non-symlink file" >&2
      exit 43
    }
    printf "counter=7\n" > /tmp/approved-state
    cmp -s /src/state.txt /tmp/approved-state || {
      echo "state.txt bytes are not approved" >&2
      exit 44
    }
    [ ! -e /dst/state.txt ] || {
      echo "candidate already has state.txt" >&2
      exit 45
    }
    cp /src/state.txt /dst/state.txt
    cmp -s /dst/state.txt /tmp/approved-state || {
      echo "copied state verification failed" >&2
      exit 46
    }
  '

docker inspect --type=container rlv-v09-migrate >"$LAB/evidence/V09.migrate.inspect.json"
docker start -a rlv-v09-migrate \
  >"$LAB/evidence/V09.migrate.stdout" \
  2>"$LAB/evidence/V09.migrate.stderr"

Do not recursively copy V04 into V09. Doing so would reintroduce legacy.txt and overwrite B’s seed.txt, recreating the alignment problem instead of repairing it.

After migration, the required V09 tree is exactly:

new.txt   -> new=B\n
seed.txt  -> seed=B\n
state.txt -> counter=7\n

legacy.txt and keep.txt must be absent. Compare V04 again against its pre-migration A-plus-state manifest; the source must remain unchanged.

Only then create the final B probe against V09, record its actual .Image, .State and .Mounts, and run the non-writing application-contract check. If observed evidence proves actual B image ID + V09 lineage + exact B-plus-state bytes + unchanged V04, the narrow fixture qualifies for ACCEPT.

That acceptance says nothing about database transaction boundaries, crash consistency, schema compatibility, replication or distributed durability. This experiment migrates one approved regular file containing one line.

Reconcile the ten-case evidence manifest

The complete ledger prevents a favorable V09 from erasing inconvenient controls. Every observed-status cell remains NOT EXECUTED in this article.

Case

Preparation

Intended subject

Required phases

Exact expected membership

Preservation assertion

Expected decision

Observed status

V01

Verified image A, no volume

A / none

create, inspect, start, full compare

seed=A\n; legacy=A\n

source oracle unchanged

ACCEPT control

NOT EXECUTED

V02

Verified image B, no volume

B / none

create, inspect, start, full compare

seed=B\n; new=B\n

source oracle unchanged

ACCEPT control

NOT EXECUTED

V03

Fresh empty V03

A / V03

inspect empty precondition, create-not-started, observer compare

seed=A\n; legacy=A\n

observer cannot populate

ACCEPT control

NOT EXECUTED

V04

Fresh V04 → A population → add approved state

B / preserved V04

pre/post manifests, remove A consumer, create B, inspect

seed=A\n; legacy=A\n; counter=7\n

V04 retained for V09/V10

REPAIR_ALIGNMENT

NOT EXECUTED

V05

Fresh empty V05

B / V05

create, inspect, compare

seed=B\n; new=B\n

V04 untouched

HOLD_STATE

NOT EXECUTED

V06

Independently verified empty V06

B no-copy / V06

empty precondition, create, inspect, compare

empty tree

no sentinel inserted

HOLD_SEED

NOT EXECUTED

V07

V07 contains only approved unrelated file

B / V07

prepare, verify precondition, create, inspect, compare

keep=unrelated\n only

precondition independently recorded

HOLD_SEED

NOT EXECUTED

V08

Independent A-plus-state V08

B no-copy / V08

prepare, before compare, create, after compare

seed=A\n; legacy=A\n; counter=7\n

before = after

REPAIR_ALIGNMENT

NOT EXECUTED

V09

Fresh V09 → B seed → selective state copy from V04

B / V09

seed verification, source check, selective copy, preservation check, B probe

seed=B\n; new=B\n; counter=7\n

V04 remains exact A-plus-state

ACCEPT

NOT EXECUTED

V10

Preserved V04 from V04 after V09 review

A / V04

stop/remove controlled B consumer, create A, inspect, probe, compare

seed=A\n; legacy=A\n; counter=7\n

candidate V09 retained; V04 exact

RESTORE_CONFIRMED

NOT EXECUTED


V09 and V10 explicitly depend on V04’s preserved original. V05–V08 do not. This makes lineage errors visible: a later record claiming that V09 sourced state from V05, or that V10 rebuilt the original volume from scratch, fails the experiment even if the final filenames look plausible.

The same requested-versus-observed discipline appears in Refonte Learning’s article on separating Compose interpolation from runtime values. Compose itself is outside this laboratory; the relevant lesson is evidentiary. A declaration, command line or rendered request is not interchangeable with the runtime object and bytes that must be accepted.

Reject incomplete or mismatched evidence

A verifier should require exactly one unique record for each ID V01 through V10 and reject missing or duplicate case IDs. Each case record should identify:

  • research/run batch, daemon endpoint and context;

  • Docker client, daemon, API and builder versions;

  • base digest approval record and A/B image IDs;

  • exact create/start/helper argv;

  • stdout, stderr and numeric exit status for every CLI operation;

  • subject-container .State, actual .Image, requested .Config.Image and complete .Mounts;

  • volume create command, initial inspect metadata, labels, driver and preparation history;

  • every expected precondition and complete content snapshot;

  • source and destination comparisons where migration occurs;

  • original-volume preservation checks before and after V09;

  • V10 restoration evidence.

A generic nonzero exit is not a verdict. docker create returning nonzero means Docker failed the creation operation and should be evaluated with its stderr and phase context. A successfully created container whose application-contract probe exits 44 means something different: Docker may have created and started the object correctly while the declared content check failed. The ledger must preserve the distinction.

Negative verifier checks should also be designed before execution. They should reject a missing V07 record, a V09 record whose image ID differs from the approved B ID, an unexpected extra.txt, a symlink where a regular file is required, a changed V04 after migration, duplicate volume identities masquerading as one lineage, or restoration evidence that merely references a requested tag without proving the restored container’s actual image.

These checks are proposed, not run. No “green” aggregate can be emitted while the ten cases remain NOT EXECUTED. Missing restoration evidence is also blocking even if V09 appears otherwise acceptable.

Restore the previous image-and-volume tuple

V10 validates restoration of the previous known combination, not merely rollback of an image tag. Stop and remove only the controlled B consumer associated with the candidate deployment; retain the V09 candidate volume for review. Recreate A against the preserved V04 original.

set -euo pipefail
: "${IMG_A_ID:?}"
V04=rlv-v04-original

if docker container inspect rlv-v09-b >/dev/null 2>&1; then
  docker stop rlv-v09-b
  docker rm rlv-v09-b
fi

docker create --name rlv-v10-restored-a \
  --mount type=volume,src="$V04",dst=/srv/state \
  "$IMG_A_ID" true

docker inspect --type=container rlv-v10-restored-a \
  >"$LAB/evidence/V10.restored.inspect.json"

The only acceptable expected V10 tree is the preserved A-plus-state manifest: seed=A\n, legacy=A\n, counter=7\n, with new.txt absent. The review must prove actual A image ID, V04 lineage and exact content. The broader release discipline of proving runtime replacement and preparing rollback is relevant to that provenance discipline, but the Docker named-volume semantics here come from Docker’s own documentation.

This isolated fixture has no traffic and no post-migration application writes. Consequently, RESTORE_CONFIRMED cannot demonstrate reversal of external writes, rollback across incompatible schemas or recovery from concurrent mutation. It proves only that the preserved prior image-and-volume tuple still matches its declared bytes.

Preserve all evidence before cleanup. Cleanup must be allowlisted to the named containers, volumes and lab directory created for this batch; never use broad pruning as part of the test. Most importantly, deleting the original volume is never a repair step.

Assign ACCEPT, REPAIR, RERUN and HOLD decisions

The decision vocabulary belongs to this release process, not to Docker itself.

Decision

Required meaning

ACCEPT

Observed B actual image ID, approved replacement-volume lineage, exact B-plus-state content, complete evidence and unchanged preserved original

REPAIR_ALIGNMENT

Approved B image is running against explainable retained A content; repair the image/state combination without deleting the original

HOLD_STATE

Seed is aligned to B but required application-owned state is missing

HOLD_SEED

Mounted content is empty or unrelated-only and does not supply the required B seed

HOLD_EVIDENCE

Evidence is incomplete, ambiguous, unexecuted, internally inconsistent or cannot resolve identity/lineage/content

RERUN

Environment, approved base/source, versions or procedure changed, or execution was interrupted so the existing evidence no longer qualifies the declared run

RESTORE_CONFIRMED

Actual A image ID is recreated with the preserved original volume and exact A-plus-state manifest

An expected negative case can pass its experimental expectation while remaining unacceptable for deployment. For example, if V06 really produces an empty tree, that is a successful observation of the V06 hypothesis and still a HOLD_SEED release result. Likewise, V04 can be a perfectly reproducible demonstration of named-volume reuse while requiring REPAIR_ALIGNMENT.

Ownership is similarly explicit. The application owner declares which state may be preserved and what B-plus-state means, including the decision that only state.txt=counter=7\n migrates. The platform owner controls the isolated daemon, volume creation and lineage, helpers, mount modes, stopped-consumer preparation and preservation of V04. The release reviewer validates case completeness, actual image IDs, manifests, exit semantics and restoration evidence before approving the aggregate decision.

No overall green verdict is permitted with unresolved image identity, ambiguous volume lineage, missing original-preservation checks or absent V10 restoration evidence.

Because this article contains no measured run, its own status is HOLD_EVIDENCE / overall HOLD as of November 26, 2026. Documentation can justify the expected model; it cannot substitute for executing and reviewing the laboratory.

Continue with Refonte Learning's DevOps Engineering Program

This exercise connects container behavior to the broader operational skills required in release engineering: reproducible Docker work, explicit state ownership, CI/CD evidence gates, infrastructure control and disciplined review. The Refonte Learning program page checked on November 26, 2026 describes a DevOps curriculum covering Linux, Git and GitHub, CI/CD, Docker and Kubernetes, Terraform, cloud platforms, and monitoring and logging.

For engineers who want a structured curriculum around those foundations, review the Refonte Learning DevOps Engineering Program. The page is the authoritative source for its current scope; this article does not infer specialized named-volume exercises, teaching versions, placements or employment outcomes beyond what the program itself states.