Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind mounts and user #95

Open
andymarden opened this issue Jan 27, 2024 · 1 comment
Open

Bind mounts and user #95

andymarden opened this issue Jan 27, 2024 · 1 comment

Comments

@andymarden
Copy link
Contributor

I created the docker container running as fileshelter:fileshelter

Create a user filehshelter:fileshelter on host

Created /mnt/fileshelter on host (777 to get it to work)

Bind volumes set as:

  • /mnt/fileshelter:/var/fileshelter (rw)
  • /mnt/fileshelter/fileshelter.conf (rw)

What I get in /mnt/fileshelter is:

drwxr-xr-x 2 root    root     4096 Jan 27 12:46 fileshelter.conf
-rw-r--r-- 1 postfix crontab 32768 Jan 27 12:27 fileshelter.db
drwxr-xr-x 2 postfix crontab  4096 Jan 27 12:27 uploaded-files
-rw-r--r-- 1 postfix crontab   317 Jan 27 12:27 user_messages.xml
-rw-r--r-- 1 postfix crontab   332 Jan 27 12:27 wt_config.xml

Erm - what is going on. We have the conf file owner by root and the others owned by postfix

I though they would all be owned by fileshelter.

Will this work if I upload files since postfix owns that dir.

Confused as to what should happen and why this is happening.

@andymarden
Copy link
Contributor Author

Ok - so the fileshelter.conf is a directory - sue to the stupid docker "if you mount one thing and it doesn't exist I will assume it is a directory

Touching the file first didn't seem to work - it told me that '' was not an absolute working dir.

Got it working in the end by creating var and config as subdirs under /mnt/fileshelter and then mapping var to var and the conf file to config/fileshelter.conf but only after copying the fileshelter.conf as supplied from the docker container, putting it at the right place and 777 permissions.

I am sure it could be simplified but my head hurts and it works.

I almost seems that the conf file needs to be read before the stuff is created the first time for the container (which would be bonkers)

Life would be so much easier is all the stuff that needed to be exposed was in one directory in the docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant