我正在运行以下带有Postgres服务的Docker Compose文件:
然而,我的容器一直在重启,当检查日志时,我收到了以下消息:
有人知道这个问题的来源吗?
docker-compose.yml:
version: "3"
services:
db:
image: postgres:latest
restart: always
container_name: dev_db
environment:
- POSTGRES_HOST_AUTH_METHOD = trust
ports:
- 5435:5432
volumes:
- dev_data:/var/lib/postgresql/data
- ./dbscripts/postgres:/docker-entrypoint-initdb.d
volumes:
dev_data:
然而,我的容器一直在重启,当检查日志时,我收到了以下消息:
Error: Database is uninitialized and superuser password is not specified.
You must specify POSTGRES_PASSWORD to a non-empty value for the
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
connections without a password. This is *not* recommended.
See PostgreSQL documentation about "trust":
https://www.postgresql.org/docs/current/auth-trust.html
有人知道这个问题的来源吗?