I have the latest Docker Toolbox RC running on OS X (VirtualBox driver).
IP of Docker host is:
$ docker-machine ip
192.168.99.100
I'm running a container like this:
$ docker run -ti -p 4505:4505 my_image /bin/bash
[root@blah /]#
I've attempted to check whether I can access this port from an entirely different machine, running Windows 10, on my network:
$ nmap -p 4505 192.168.99.100
Starting Nmap 7.01 ( https://nmap.org ) at 2016-02-04 17:18 W. Europe Standard Time
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 0.74 seconds
How can I make the container and other machines on my network see each other?
Edit: the accepted answer below makes it possible to access the container on specified ports via the IP address of the physical machine. That is, you do not access the container via 192.168.99.100:4505
. Instead, it can be accessible via your machine's <IP>:4505
.
If you're using the VirtualBox driver with docker-machine to run a Docker VM on your Mac, then you can forward the port from your Mac to the VM like this:
Let's break this down:
docker-machine ls
).You can find the official documentation for this command at https://www.virtualbox.org/manual/ch08.html#vboxmanage-controlvm