Search code examples
macosnetwork-programmingdockerboot2docker

Mac: how to remotely access server running inside docker container from other computers?


First I installed boot2docker on OSX 10.10, then I successfully ran a web container. With port redirection configuration, I can browse the web server by localhost:8080 in the browser. Now I want to access the server from other computers, in the same WLAN, by using of url my-mac-ip:8080. I googled over and tried many ways, still not figured out the solution.

I found similar question, but iptables doesn't work for OSX.

I'm new to Docker and I'm not familiar with network configuration, please help me out! Thanks!


Solution

  • This sounds like it isn't a Docker problem because you can access localhost:8080. I think you need to open port 8080 on your laptop to make it possible for others to access it from outside.

    To open a port under Max OS X 10.10 foolowd this guide, it describes how to usw pfctl for port forwarding.