Docker for mac networking example

broken image

can also pass as env var:Ĭontainer # ping This is for development purpose and will not work in a production environment outside of Docker Desktop for Mac. Which resolves to the internal IP address used by the host. The host has a changing IP address (or none if you have no network access).įrom 18.03 onwards our recommendation is to connect to the special DNS name , I WANT TO CONNECT FROM A CONTAINER TO A SERVICE ON THE HOST Or you can just use inside docker VM will ok. Solution Docker for Mac: use įor Docker on Mac, there is a magic ip 192.168.65.2 in docker VM which represent host machine,

broken image

I have redis running in localhost, when I run a docker VM, I want to connect redis from inside of Docker VM, so I do not need docker-compose for another redis VM.