docker-library / postgres

Docker Official Image packaging for Postgres
http://www.postgresql.org
MIT License
2.16k stars 1.13k forks source link

data directory "/var/lib/postgresql/data/pgdata" has invalid permissions error when trying to run image #1069

Closed jchapmantcg closed 1 year ago

jchapmantcg commented 1 year ago

This is on a Windows Server 2019 box running Docker Desktop

docker run -d --name postgres --restart=unless-stopped --user postgres -p 5432:5432 -e POSTGRES_PASSWORD=password -e PGDATA=/var/lib/postgresql/data/pgdata -v c:\DockerVolume\postgres:/var/lib/postgresql/data postgres

results in the errors [83] FATAL: data directory "/var/lib/postgresql/data/pgdata" has invalid permissions [83] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750)

tianon commented 1 year ago

Unfortunately, we do not have the bandwidth to provide in-depth integration/deployment/environment debugging or support here; these sorts of questions/requests would be more appropriately posted to a dedicated support forum, such as the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow.

(I'd recommend exploring a named volume or better yet putting the files directly inside the Linux VM at a path you actually control.)