A bind mount over an image directory hides the image files at that path for that container. The files may still exist in the image; an empty or wrong host source can be what you are actually viewing.
Inspect the boundary before changing the service
The commands below use placeholder names. They illustrate a diagnostic workflow and were not run against a live container in this review. Match the Docker context and project before inspecting your own service.
docker inspect demo --format '{{json .Mounts}}'
# For each mount, compare Type, Source, Destination and RW.
# On the daemon host, inspect the exact Source path before changing it.
# Do not delete either tree to make their contents match.What to compare
Suppose the image has application dependencies in /app/node_modules, while a development bind mount places a host project at /app. The mount covers the entire destination subtree. A missing dependency can therefore be a mount-layout issue rather than evidence that the image build skipped installation. A similarly named local directory is not proof that the daemon mounted the directory you intended, especially when a remote Docker context is active.
Choose the next action
Record the source and destination from the actual container, then compare them with the intended Compose or run configuration. Check the source on the daemon host. Plan a replacement container without the covering mount only after preserving writable data and following your service deployment procedure. For a read-only source tree, an intentional read-only mount can prevent accidental writes; it does not reveal hidden image files. Prefer a narrowly scoped mount when only one configuration file needs to be supplied.
Limits and verification
The short -v form can create a missing host directory, whereas the explicit --mount form normally reports a missing source unless an appropriate creation option is used. Do not use that difference to probe production paths blindly. No existing container or host directory was changed here. Named volumes have additional initialization behavior and need their own review; this diagnosis specifically concerns a bind mount.
Related: Data Missing After Compose Down: Check Volume Identity Before Restoring.
Official Docker documentation checked November 10, 2026 (KST). Docker Compose 2.35.1 configuration parsing was available, but the Docker daemon was not running. These pages do not claim a live container connectivity, storage, health or recovery test.