How to see website of docker server from internet in win7?
install docker toolbox
in win7 64bit
I can't access docker server from internet.
I can see webpage of native server in win7 from internet without any problem.
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DO
CKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1
8.06.1-ce
$ docker ps
CONTAINER ID IMAGE COMMAND
CREATED
STATUS PORTS
NAMES
65b815ffa17c richarvey/nginx-php-fpm "docker-php-entrypoi" 4 hours ag
o Up 4 hours 80/tcp, 443/tcp, 9000/tcp, 0.0.0.0:8000->8000/tcp
web
host (win7) <---> VM guest <---> docker container
I believe
adapter 1 NAT
is VM guest <---> docker container
part.
adapter 2 host-only
is host (win7) <---> VM guest
part.
so I can never connect docker container over outside internet in this setting.
try 1
If I try to change adapter 2 bridge
from host-only
, it will generate error or jump back to host-only
.
try 2
change ip from windows' adapter
I change VirtualBox Host-Only Network #2
1 ) Go to Control Panel -> Network and Internet -> Network Connections
2 ) Right Click on VirtualBox Host-Only Network #2
and select Properties
3 ) Select Internet Protocol Version 4(TCP/IPv4) and click Properties
4 ) click obtain an IP address automatically
result:
It generates a VirtualBox Host-Only Network #3
adapter with original parameter...
$ docker-machine start default
Starting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to create a network adapter. Some
times, such confirmation window is minimized in the taskbar.
(default) Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter
#3"
(default) Windows might ask for the permission to configure a network adapter. S
ometimes, such confirmation window is minimized in the taskbar.
(default) Windows might ask for the permission to configure a dhcp server. Somet
imes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
try 3
1 ) Go to Control Panel -> Network and Internet -> Network Connections
2 ) Right Click on VirtualBox Host-Only Network #2
and select Properties
3 ) Select Internet Protocol Version 4(TCP/IPv4) and click Properties
4 ) Give to the adapter a static IP address
that is valid on your current real network. Make sure the DNS is also valid so the container will be able to resolve domains on the Web
result: useless, just like try 2
try 4
...
update ok, I know why.
I set my firewall wrong. DMZ should be on host IP instead of VM IP.