check file permissions when a container cannot write

A container may start correctly but fail when it tries to write to a mounted directory.

Check the directory ownership:

ls -ld /path/to/data

Then compare it with the user running inside the container:

docker exec container_name id

Many mysterious database and configuration errors are simply volume permission problems.