On Docker Desktop (Windows 10), i'm unable to start postgres container with docker-compose
version: '3'
services:
postgres:
image: postgres:latest
environment:
- POSTGRES_PASSWORD='somepassword'
- POSTGRES_HOST_AUTH_METHOD=trust
Getting error that password is not set:
$ docker-compose up --build
Starting complex_postgres_1 ... done
Attaching to complex_postgres_1
postgres_1 | Error: Database is uninitialized and superuser password is not specified.
postgres_1 | You must specify POSTGRES_PASSWORD to a non-empty value for the
postgres_1 | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
postgres_1 |
postgres_1 | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
postgres_1 | connections without a password. This is *not* recommended.
postgres_1 |
postgres_1 | See PostgreSQL documentation about "trust":
postgres_1 | https://www.postgresql.org/docs/current/auth-trust.html
complex_postgres_1 exited with code 1
However, on Linux (CentOS 8) all works fine, even without last line - POSTGRES_HOST_AUTH_METHOD=trust
Has anyone experienced same issue on Windows 10 ?
Docker desktop is on latest version as well as docker-compose command
"POSTGRES_PASSWORD=somepassword"