Spent quite sometime on this but no breakthrough. This is my container creation statement:
> docker create --name aasaan_db_dev -e POSTGRES_USER=aasaan -e
> POSTGRES_PASSWORD=aasaan_admin --expose 5432 postgres:9.4.0
>
> > deepakkt@deepakkt-ubuntu:~$ docker ps
>
> CONTAINER ID IMAGE COMMAND
> CREATED STATUS PORTS NAMES
> 15b21deb19a0 postgres:9.4.0 "/docker-entrypoin..." About
> an hour ago Up About an hour 5432/tcp aasaan_db_dev
The following works:
> deepakkt@deepakkt-ubuntu:~$ docker exec -it aasaan_db_dev psql -U
> aasaan psql (9.4.0) Type "help" for help.
>
> aasaan=#
However, from the host (same error from pgAdmin as well)
> deepakkt@deepakkt-ubuntu:~$ psql -h 127.0.0.1 -U aasaan
Password for user aasaan:
psql: FATAL: password authentication failed for user
> "aasaan" FATAL: password authentication failed for user "aasaan"
Contents of pg_hba.conf inside the container:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local replication postgres trust
#host replication postgres 127.0.0.1/32 trust
#host replication postgres ::1/128 trust
host all all 0.0.0.0/0 md5
What am I missing?