← Docker: run and diagnose containers
10 / 12 · 60 MIN

Data, persistence and validated recovery

Distinguish data lifecycles, permissions and resource usage, and assess recovery through consistency, RPO and business acceptance.

What changes when an instance is recreated

A manual fix in the writable layer may survive restart of the same instance and disappear when the container is removed and recreated. Make it reproducible through maintained artifacts or configuration and validate a new creation. An existing volume has another lifecycle. If it already contains data and mounts at /data, it obscures that path’s files in the new image. Empty-volume seed is not automatic migration of populated volumes. Record application version separately from the version or structure of persistent state before deciding recovery.

Persistence needs a deliberate destination

The fictional case stores the only reconciliation file in tmpfs. Before stopping, preserve the needed result in an authorized destination and confirm integrity. A container name does not turn temporary into persistent storage. Documentation also notes that tmpfs may use swap; it should not be presented as an absolute guarantee of no data on disk. For anonymous volumes created with --rm, consider removal associated with the container. Define beforehand which data may disappear, which need retention and which identity locates the correct resource.

Permissions need review per mount

A read-only root filesystem does not necessarily prevent writing to an explicitly writable volume. Review each destination and protection scope. A read-only bind with submounts also needs attention to kernel and recursive options: documentation makes recursive readonly depend on Linux 5.12 or later. The relevant host belongs to the runtime, not merely the operator’s laptop. In another scenario, -v creates a missing source as a directory when the application expected a file. Confirm existence, type, owner and contents before applying without turning a path error into broader permission.

Capacity and cleanup with identity

Growth may occur in the writable layer, volumes or logs. A stable database volume does not exclude other consumers. Under capacity pressure, identify source, owner and retention before removing resources. A volume without an active container may remain reserved for recovery. Contain growth and select authorized actions with measurable benefit while preserving data and evidence. The same precision applies to CPU: --cpus defines a limit rather than exclusive core reservation. Observe contention and throttling before promising business capacity based solely on a configuration value.

Checksum, consistency and RPO are distinct criteria

An archive that opens and matches a checksum demonstrates copy integrity under that criterion, not transactional consistency of a database captured during writes. Choose an application-supported method and rehearse restoration with verifiable results. In the exercise, the last confirmed point is 09:42 and failure occurs at 09:50. That is eight minutes, three beyond the approved five-minute RPO. The calculation estimates neither operation count nor value. Process startup time also does not reduce the data window that still lacks confirmed recovery evidence.

Reversal workshop with incompatible state

A previous image may remain available while being unable to read records produced by the new version. Before declaring rollback ready, define how to recover or reconcile data compatibility and later effects. Do not remove a mixed volume to obtain new seed rules when it also contains historical results. Prepare handover with effective configuration, per-service state, recoverable point, business results and decisions accepted by owners. These sheets are original documentary exercises; an available runtime and isolated rehearsal remain necessary for operational validation of the actual procedure.

IN PRACTICE

Exercise: recoverable point 09:42, failure 09:50, approved RPO 5 min. Time exposure 8 min, gap 3 min. A correct checksum changes neither that window nor database-consistency evidence.

Common pitfalls

Treating seed as migration; keeping the only result in tmpfs; assuming read-only root protects every mount; cleaning volumes without an owner; confusing checksum, RPO and startup time.

Related topics: Processes and images · Data and mounts · Compose: overrides, data and acceptance

Take this idea with you

Recovery depends on data identity and consistency alongside image and process. Preserve required state and validate the outcome before closing the intervention.

Create account

Reference: Volumes · Docker Engine Linux containers, BuildKit and Compose; official documentation consulted 2026-09-30; version-dependent behavior explicitly scoped

Docker® is a registered trademark of Docker, Inc. bigsavant.com is an independent preparation platform and is not affiliated with, associated with, sponsored, authorised or endorsed by Docker. Content and questions are original, are not official exam questions, and completing our tests does not award or guarantee any certification. Names are used only to identify the subject. All other trademarks belong to their respective owners.