I am facing issue in bind mount in docker desktop for windows and error is resolved by creating volumes, but i have to use bind mounts or please tell me how to access the volumes in windows 10. Please help.
Here is my compose file:
services:
postgresdb:
image: postgres:10.14-alpine
container_name: postgresdb
restart: always
environment:
- POSTGRES_PASSWORD=123456
# - PGDATA=/postgresql/data
volumes:
- ./data/postgresdb:/var/lib/postgresql/data
- ./db:/docker-entrypoint-initdb.d/
ports:
- "5432:5432"
Error in container logs:
PostgreSQL Database directory appears to contain a database; Skipping initialization
2020-10-16 13:20:30.944 UTC [1] FATAL: data directory "/var/lib/postgresql/data" has group or world access
2020-10-16 13:20:30.944 UTC [1] DETAIL: Permissions should be u=rwx (0700).