My spring boot app is connecting to postgres and I want to set /etc/hosts
like in add-postgres-port-hosts but my container refusing to run when I try to run it using docker run -d -p 8080:8080 springio/flyaway-postgres
it fails to run in the background because it tries to find localhost inside the container -
Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections
So how can I run docker exec [container] nc -v -z localhost 5432
in a container that I cannot run in detach mode?
Thank you.