Interview Prep/Docker/Containers that exit, crash or misbehave

`docker cp` fails: `Error: No such container:path` or copies nothing from a volume path.

IntermediateTroubleshootingContainers that exit, crash or misbehave
Answer

Likely causes → Wrong path, the path is a tmpfs mount (not supported by docker cp), or the container doesn't exist.

Diagnose → docker exec c ls -l /path; docker inspect -f '{{json .Mounts}}' c.

Fix → Copy from a regular path, or use a helper container with --volumes-from; use docker exec c tar c ... | tar x.

Prevent → Know which paths are tmpfs.

All Docker questions Roadmap: Docker & containers

More on Containers that exit, crash or misbehave