Create a postgres docker container with below command:
docker run -v /home/ec2-user/Vteck-postgres-data:/var/lib/postgresql/data -d -e POSTGRES_USER=odoo POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name vteck-db postgresaccess Docker container:
docker exec -it vteck-db bashConnect with the client:
root@f1ba565db798:/# psql -U postgres psql: error: could not connect to server: FATAL: role "postgres" does not exist
but if I create Docker container with
docker run --rm -d -e POSTGRES_PASSWORD=root --name postgres postgres,
I can successfully connect with psql - U postgres.
Any problem with my first step's command?