Docker Community Forums

Share and learn in the Docker community.

Ports in host network namespace are not accessible

(Errordeveloper) #1

Expected behavior

If I start a container with --net=host, which listens on some number of ports, I expect to be able to access those ports from outside the VM.

Actual behavior

Ports are only accessible inside of the VM.


OS X: version 10.11.4 (build: 15E65) version v1.11.0-beta9
Running diagnostic tests:
[OK]      docker-cli
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160503-161859.tar.gz
Most specific failure is: No error was detected
Your unique id is: 495A52D1-60EF-47B2-8652-6C2F8A3924BA
Please quote this in all correspondence.

Steps to reproduce the behavior

Weave Scope is an example of an application that needs to run in host network namespace and users expect to access it on port 4040 of the VM it’s running on.

  1. curl -sLO
  2. chmod +x ./scope
  3. ./scope launch