Docker Community Forums

Share and learn in the Docker community.

Access host machine from container in Docker Machine


(Topher1120) #1

Hi there,
<TL;DR> How can I access services on a Windows host from a container started in Docker Machine?

Longer explanation:
I have a Linux-based web app that uses MS SQL Server on Windows as the database. I need to create a Docker container for the web app and am having some trouble with the setup so I can test.

I’m running Windows 10 and have SQL Server installed locally. I opted for Docker Machine because Docker for Windows requires HVM, which kills VirtualBox and I have other VMs I run for other development purposes and don’t want to lose access to them.

I’m able to connect to the host via a “normal” VM in VirtualBox and test the connection via Telnet. Trying the same using an Alpine container hangs. I’m sure part of this is a “peeling the onion” issue because the container is running in a VirtualBox VM inside a Windows host. I also don’t understand Docker networking enough to get this to work.

Thanks in advance for your help!