I got postgres.app running locally on my Mac and would like my local docker container to be able to connect to it. How do I best do this?
I found this post that suggests to pass the Docker host’s IP address to a container using the --add-host flag (Host port with DB to Docker container). However, my laptop's IP address changes frequently. Isn't there an easier way of doing this? Isn't there an easy way to open a local port to a container?
172.17.0.1by default. It works nicely on a Linux host, but I am not sure that would work on a Mac.docker run -it --rm ubuntu, once inside:apt update && apt install telnet && telnet 172.17.0.1 5432and see whether it can connect or not.