While testing the final setup of the folders monitored by my Mayan EDMS installation, I discovered that incorrect folder permissions would stop files from being processed by this document management system. This post explores why some of my troubleshooting assumptions were wrong.

My Setup

I use /etc/fstab to mount some directories from an SMB share:

//<smb host>/docker/mayan-edms/correspondence /mnt/docker/mayan-edms/correspondence cifs uid=1000,gid=1000,file_mode=0755,dir_mode=0755,vers=3.0,credentials=<credentials file>

Findings

  1. If the permissions (owner, group and permission flags) of a folder mounted as a docker volume are changed on the host after the container is started, then those changed permissions will not be reflected in the container.
  2. Corollary: if a container is started and points to a directory that is subsequently used as a mount point on the host, then the permissions in that container for that volume will be those from the folder before the mounting took place. Though the folder may look, on the host, to have changed completely after running mount, the docker container will not reflect this until it is restarted.

Result

The lesson from this is to establish all mounts and their permissions before starting docker containers.