0

I would like to run a docker in our windows environment so that staff can access the application from their own computers, but cannot get it working.

I have tried both solutions of NAT and bridged mode that were suggested here to no avail:

How to connect to a docker container from outside the host (same network) [Windows]

When I use NAT mode, I am able to connect to the app through the localhost of the host computer (127.0.0.1:8000), when I use bridged mode I am able to use the IP of the docker machine (192.168.99.100:8000) but I cannot access them from other computers in the LAN.

I am able to ping the computer where the docker container is located from another one in the same LAN, but when I type its url into the browser, I get the standard IIS landing page. I deleted the default site in IIS in case it was taking up the port that I was trying to allocate to the docker container, but that did not work- I simply get a site cannot be reached page.

Ultimately, I just want to be able to access the app in the docker container from another computer inside the LAN on the windows server. Any ideas would be appreciated.

Edit: I should mention that the person who takes care of the domain LAN, domain controller, said he could set a specific IP address for to connect to the virtualbox (docker container) but does not have any idea of how to do that- he has never heard of docker and unfamiliar with virtualbox.

Community
  • 1
  • 1
ivan7707
  • 1,146
  • 1
  • 13
  • 24
  • How about splitting the problem into two: (1) connect from your host to the app in the docker, (2) connect from other machines to your host? You have already solved (1) with NAT, so this questions is no longer about docker. It is question (2) now: how you let one Windows machine talk to another one on port 8000. So ask this question: "My app running locally on 127.0.0.1:8000 in Windows, how do I let other Windows machines talk to it?" – Oleg Sklyar Aug 24 '16 at 23:21
  • @OlegSklyar great point! I've been looking at this so long, it is all looking the same to me. I'll start looking into that specific issue tomorrow. I have been learning about tcp, ip, gateways, etc tonight to get a better idea of what I am dealing with. – ivan7707 Aug 25 '16 at 01:00

1 Answers1

1

What finally worked for me was the following:

Virtualbox setup

  • I deleted the former virtual env because I was unsure of all of the tinkering I had done to that point
  • docker-machine create -d virtualbox default # to create new virtual machine
  • power off default virtual machine
  • choose settings, network Adapter 3, enable network adapter
  • choose bridged network, note the mac address that shows up
  • set promiscuous mode to allow all
  • click ok
  • docker-machine start default

Virtualbox settings

  • Show the VM screen (either headless start, or show)
  • adduser # this is for the ssh test so strictly not necessary
  • type ifconfig and find whichever ethernet has the mac address you noted above usually either eth0 or eth1 (also take a look at the inet addr)
  • use Putty (from windows) to ssh whateveryourname@inetaddr
  • type in the password for the user you created, and you should be able to ssh into the VM now - Setting the static IP
  • in the bash type: sudo ifconfig eth1 netmask 255.255.255.0
  • type ifconfig to check if it changed - Application
  • run your docker-compose script and access the application on staticIP:port# or just staticIP from your LAN depending on how NGINX is setup
ivan7707
  • 1,146
  • 1
  • 13
  • 24