A container works, but nobody remembers where it writes its files. docker diff answers that without any digging.
It compares the container’s filesystem with the image it came from and lists the difference.
docker diff mycontainer
Each line starts with a letter. A is a file or directory that was added, C means changed and D means deleted. In the docs example for nginx you see A /run/nginx.pid and C /var/log/nginx, which tells you right away where it keeps its pid file and its logs.
This is a good first step before you decide which paths need a volume, or whether a container can run with --read-only.
Compose users can run the same thing by container name from docker compose ps. It is read-only, so there is nothing to break and it is safe to try on a container you are unsure about.
The caveat: it only shows changes in the container’s writable layer. Data in a mounted volume or bind mount is not listed, and it is gone when the container is removed, so run it before you delete anything.
Further reading: docker container diff, On this site: watch docker events to see exactly when a container dies, On this site: docker ps –format table gives you a readable overview, On this site: 🐳Comprehensive Guide: Updating Docker Containers via the Unraid Terminal