currently I am containerizing a production server. I am using docker compose to create multiple services which need to have access to multiple directories including the subdirectories.
Yes, every file as well as every directory is owned by the same user and the permissions are the same. I am able to execute the scripts in the directory, also I am able to write in this directory. Mounting the subdirectories manually also works as expected, but I cannot mount all thousand subdirectories manually - Life is too short for that.
Are those subdirectories mounted to the host too? Also what kind of Docker are you using? Docker CE or Docker Desktop? Or maybe Docker CE installed as a snap package?
In case of a regular directory and regular Docker CE, subdirectories couldn’t be hidden. A bind mount is just adding another path alias to the same inode (file/folder id), so you would always see the same even if you have no access to the subdirectories in a container, you just couldn’t list the contents maybe and get an error message.
Also what kind of Docker are you using? Docker CE or Docker Desktop?
I am using Docker CE.
Or maybe Docker CE installed as a snap package?
Docker was installed via apt according the steps written in the documentation
In case of a regular directory and regular Docker CE, subdirectories couldn’t be hidden. A bind mount is just adding another path alias to the same inode (file/folder id), so you would always see the same even if you have no access to the subdirectories in a container, you just couldn’t list the contents maybe and get an error message.
Yes, this information fits my understanding of bind mounts, yet, those subdirectories are not mounted. It is quite mysterious to be honest, since mounting those subdirectories manually works like a charm.
I have tried different syntaxes for the bind mount, namely, specifying the the mounting options with type, target, etc.