Answer the question
In order to leave comments, you need to log in
How to connect using psql to a subd located inside a docker container?
Good afternoon, I have PostgresSQL running inside a docker container and I want to connect to it using the psql utility:
sudo psql -h localhost -p 5432 -U postgres -d master
FATAL: password authentication failed for user "postgres"
version: "3.4"
networks:
default_network:
ipam:
config:
- subnet: 18.129.0.0/16
services:
postgres:
image: postgres:11
networks:
- default_network
ports:
- ${DB_EXTERNAL_PORT}:${DB_INTERNAL_PORT}
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${USER}
POSTGRES_PASSWORD: ${PASSWORD}
volumes:
- ./db_data:/var/lib/postgresql/data
DB_NAME=master
USER=postgres
PASSWORD=postgres
DB_EXTERNAL_PORT=5432
DB_INTERNAL_PORT=5432
DETAIL: Role "postgres" does not exist.but anyway, how can a role not exist if it is set in POSTGRES_USER or is there a role under the role here?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question