Postgres: postgree:9.4 doesn't run on docker

Created on 6 Jun 2020  Â·  1Comment  Â·  Source: docker-library/postgres

example-voting-app % docker run -d --name=db postgres:9.4
starts running
7da82b961e8b3e10eb18b04e3dd04f43be1962b2e04552f04621c90479265865

but when i do docker ps -a
7da82b961e8b postgres:9.4 "docker-entrypoint.s…" 18 seconds ago Exited (1) 17 seconds ago db

Please help

question

Most helpful comment

As per the docker hub README, you need to provide -e POSTGRES_PASSWORD. In fact, if you do docker logs db, you will see:

$ docker logs db
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD for the superuser. Use
       "-e POSTGRES_PASSWORD=password" to set it in "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

Also, Postgres 9.4 is EOL -- I would recommend that you use a later version of Postgres if possible (see also https://www.postgresql.org/support/versioning/)

>All comments

As per the docker hub README, you need to provide -e POSTGRES_PASSWORD. In fact, if you do docker logs db, you will see:

$ docker logs db
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD for the superuser. Use
       "-e POSTGRES_PASSWORD=password" to set it in "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

Also, Postgres 9.4 is EOL -- I would recommend that you use a later version of Postgres if possible (see also https://www.postgresql.org/support/versioning/)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mcnesium picture mcnesium  Â·  3Comments

andrewvo148 picture andrewvo148  Â·  3Comments

roks0n picture roks0n  Â·  4Comments

tjamet picture tjamet  Â·  4Comments

note89 picture note89  Â·  3Comments