我有一个docker编写文件,其中我使用共享卷启动PostgreSQL。但我不断地得到下面的错误。
2018-10-11 14:57:01.757 GMT [81] LOG: skipping missing configuration
file "/postgresql/data/postgresql.auto.conf"
| 2018-10-11 14:57:01.768 GMT [81] FATAL: data directory "/postgresql/data" has wrong ownership
| 2018-10-11 14:57:01.768 GMT [81] HINT: The server must be started by the user that owns the data directory.
我的docker组成文件如下
addb:
image : postgres
networks:
- private
ports:
- "5432:5432"
volumes:
- /mnt/shared/app_data/db/postgres/data_db:/postgresql/data
depends_on:
- sol-server
我使用的是RHEL7.5和Docker版本18.06.1-ce,build e68fc7。任何想法,我可以解决上述问题。
发布于 2021-09-08 21:45:51
您应该将卷与数据库一起挂载到/var/lib/postgresql/data
中,而不是/postgresql/data
中,或者指定一个环境PGDATA=/postgresql/data
https://stackoverflow.com/questions/52765707
复制相似问题