![]() ![]() I tried setting this from within the container by looking up the IP address of the host there, but I didn't feel great running a script just for this purpose. I tried using -net=host, but.that's not what we want. Something like: docker run -add-host=postgres-host:$(ip route show | awk ) I tried:īut this was also a hack because it required that docker run be put inside a script to figure out the right IP of the host machine. The keytool command is a key and certificate management utility. Probably the place where we see Unix domain sockets the most is docker. So I need to connect to that postgresql instance from a docker container running on the same server. The backstory is that I have postgresql running on the docker host because I don't trust docker to run postgresql directly. This feels like a major hack, so I'm curious if this is truly horrible in a production environment. Back story below, but here's the question: I've discovered that if I have postgresql running on my docker host, I can connect to it in a container via a domain socket mounted as a file: docker run -v /var/run/postgresql/:/var/run/postgresql
0 Comments
Leave a Reply. |