Docker Community Forums

Share and learn in the Docker community.

Port mapping does not work with native/port-forwarding=true and userland-proxy=false

docker

(Crogers) #1

Expected behavior

With pinata set native/port-forwarding true and daemon args of {"storage-driver":"aufs","debug":true,"userland-proxy":false} port mapping should work and you should be able to communicate with process inside the container over the network.

Actual behavior

With the above settings port mapping simply does not work. Mapped ports never become open, even though the port is open inside the container.

(The userland proxy should not be necessary as it is broken by design - having it enabled means mapped ports always appear open, even when they are closed in the container, which wreaks havok with external test tooling).

Information

$ pinata diagnose -u
OS X: version 10.10.5 (build: 14F1713)
Docker.app: version v1.11.0-beta8.2
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/20160424-000802.tar.gz
Most specific failure is: No error was detected
Your unique id is: A647E756-92C5-436B-B449-D0DAF2731635
Please quote this in all correspondence.

See https://docs.docker.com/engine/reference/commandline/daemon/ for user-proxy option.

Steps to reproduce the behavior

  1. Run docker run --name port-test -d -p 9999:80 nginx.
  2. Wait 10 secs for nginx to come up.
  3. Run nc -z localhost 9999; echo $?.

Step 3 prints exit code 1, showing the connection failed. You can verify the port did come up in the container by running docker exec port-test bash -c "</dev/tcp/127.0.0.1/80" and it not showing an error.