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

use volumes instead of bind mounts #52

Open
ollyg opened this issue Jan 2, 2023 · 1 comment
Open

use volumes instead of bind mounts #52

ollyg opened this issue Jan 2, 2023 · 1 comment

Comments

@ollyg
Copy link
Member

ollyg commented Jan 2, 2023

mkdir -p netdisco/{logs,config,nd-site-local} should probably be mkdir -p netdisco/{logs,config,nd-site-local,pgdata}

@rc9000
Copy link
Member

rc9000 commented Feb 3, 2023

Actually this doesn't change much, since the container will "help" on startup:

netdisco-postgresql_1  | fixing permissions on existing directory /var/lib/postgresql/data ... ok

So the only difference is that with the mkdir, I now have a 70:<my primary group> instead of a 70:root directory, but both aren't group readable anyways :)

ram@cicd:/tmp/issue52 $ ls -ld /tmp/no_mkdir/netdisco/pgdata /tmp/si_mkdir/netdisco/pgdata
drwx------ 19 70 root     4096 Feb  3 01:27 /tmp/no_mkdir/netdisco/pgdata
drwx------ 19 70 ram      4096 Feb  3 01:40 /tmp/si_mkdir/netdisco/pgdata

I suspect that a better solution to all this permission/mkdir micromanagement would be to use volumes instead of bind mounts. But I'm a bit of a troglodyte when it comes to this corner of docker, we'd probably need to look at some other projects with a similar hodgepodge of users, storage areas, config files and containers to learn how to do this properly.

I'd also expect a lot of documentation and support friction from that, so it's probably something we should only do with severe breaking changes anyways, like next time we update the Postgres major version.

@ollyg ollyg changed the title also create pgdata directory as user use volumes instead of bind mounts Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants