I'm experimenting with docker and I'm looking for the best way to have my container to communicate with a MYSQL DB running on a separate VM. The MYSQL DB is on the host's network.

SO setup is:

  • Docker host VM: (VM IP: | Container eth0
    • Container running wordpress (on apache):

I'm looking for a way connect my apache container to Just an extra detail; all VMs are running ubuntu16.04, all of them hosted on my windows laptop using virtualbox

  • Why can't you just point the container to use the MySQL server at Mar 27, 2018 at 3:01
  • Yep infact that worker. I was thinking that a network route needed to be setup to point the container gateway ( to the 192.168.56.x network Mar 27, 2018 at 8:15

1 Answer 1


When using Docker, the host's address will be the default gateway for the container. Since the host is also able to reach the MySQL VM, the routing will work out without any manual changes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .