-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Wrong ownership on bind mount #1010
Comments
Do a |
Hi @wglambert, thanks for your quick response. I've docker compose up
[+] Running 1/0
⠿ Container docker-postgres-bug-postgres-1 Created 0.0s
Attaching to docker-postgres-bug-postgres-1
Error response from daemon: error while creating mount source path '/host_mnt/Users/bigboulard/.../docker-postgres-bug/db-data/postgres': mkdir /host_mnt/Users/bigboulard/.../docker-postgres-bug/db-data/postgres: permission denied ... so I just ❯ docker compose up
[+] Running 2/2
⠿ Network docker-postgres-bug_default Created 0.1s
⠿ Container docker-postgres-bug-postgres-1 Created 0.2s
Attaching to docker-postgres-bug-postgres-1
docker-postgres-bug-postgres-1 | chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted
docker-postgres-bug-postgres-1 | chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted
docker-postgres-bug-postgres-1 |
docker-postgres-bug-postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
docker-postgres-bug-postgres-1 |
docker-postgres-bug-postgres-1 | 2022-11-09 15:20:34.043 UTC [1] FATAL: data directory "/var/lib/postgresql/data" has wrong ownership
docker-postgres-bug-postgres-1 | 2022-11-09 15:20:34.043 UTC [1] HINT: The server must be started by the user that owns the data directory.
docker-postgres-bug-postgres-1 exited with code 1 |
Looks like a few people are running into this docker/for-mac#6270 (comment) |
Bind-mounts on Docker-for-Mac do funny things with permissions. Currently the ownership of the bind-mounted directory changes to the user the container is run with (
vs.
But I still get errors starting Postgres with an empty directory: docker/for-mac#6270 (comment) |
I have the same issue on v4.21.1 / VirtioFS. Switching back to gRPC FUSE fixed it for me. Not a solution, but maybe a workaround for some until it is fixed. Apple Silicon, 13.2 |
|
I have the same issue, but only when the volume is on a NTFS partition. If someone finds a way to disable this requirement for Postgres without modifying the source, it would be great. Otherwise it seems it is simply impossible to use with this configuration, as disabling this ownership check is not possible. |
As of #1018 (about a year ago now), the NSS Wrapper behavior is available on all variants, so you should be able to simply set |
This post helped me : timescale/timescaledb-docker-ha#359 (comment) (the user:root part) |
Hi guys,
Just trying to run a
postgres 14.5
container usingcompose
ondocker-desktop
(Engine 20.10.20 and Compose: v2.12.1) onmacOS Monterey
.Everything works well using a volume, but here I need to use a
bind mount
for some reason and I get a wrong ownership error on startup.** postgres container logs**
docker-compose.yml
Thank you for your help.
The text was updated successfully, but these errors were encountered: