You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
changed the title
also create pgdata directory as user
use volumes instead of bind mounts
Feb 6, 2023
mkdir -p netdisco/{logs,config,nd-site-local} should probably be mkdir -p netdisco/{logs,config,nd-site-local,pgdata}
The text was updated successfully, but these errors were encountered: