PostgreSQL docker container on Windows
This is known limitation in Docker for Windows. The Linux <-> Windows filesystem mapping semantics from your Windows dir to the Linux dir are imperfect because the mount is done with CIFS/SMB. One of the things that won't work is chown
(changing the owner) because that cannot be mapped to your Windows filesystem.
You should probably use a named volume instead. This forum post has details: https://forums.docker.com/t/data-directory-var-lib-postgresql-data-pgdata-has-wrong-ownership/17963/24?u=friism