I apologize if this isn’t the correct forum for this question. I’m trying to run a media server container and I’m unsure how to access it from my local home network. I set the network_mode to host so that all of the container’s ports would be open.
Here is my Compose file:
version: '2’
volumes:
server-exe:
driver: local
config:
driver: local
services:
emby:
image: emby/embyserver
container_name: emby
network_mode: "host"
volumes:
- config:/config
- /e/Users/Aaron/OneDrive/TV Shows/New:/shows
- server-exe:/target
I’m able to access the web interface using http://docker:8096 on my local machine, but not on another computer on the same network.
Information
Docker version 1.11.0, build 4dc5990
Windows 10
My system’s IP: 192.168.1.8
$ ping docker
Pinging docker [10.0.75.2] with 32 bytes of data:
Reply from 10.0.75.2: bytes=32 time<1ms TTL=64
I was able to achieve this using port forwarding. For instance :
netsh interface portproxy add v4tov4 listenport=80 connectaddress=10.0.75.2 connectport=32771 protocol=tcp
Where port 32771 was the port on the docker host. I was then able to connect from other machines on my network at my desktops ip and port 80
If you don’t use 80 you’ll probably have to set up a firewall rule in Windows firewall
Would anyone use a local service that manages this for you? It would listen to the docker events and add and remove the relevant port forwards. I thought docker beta would of done this but shouldn’t be too hard to add something over the top to manage this.
It looks like they’ve addressed the issue in a recent version. I’m on 1.11.2-beta15, and just tried out the new experimental “Expose container ports on localhost” and it appears to be working perfectly for me so far.