Docker Community Forums

Share and learn in the Docker community.

Upgrading resets networking from hostnet to nat?


(Ilkka Laukkanen) #1

I was working on a VPN connection and noted that I had to set networking to hostnet to get npm connectivity for my image builds. My published ports appeared on the host as expected. Then the latest beta upgrade landed and I applied it.

I docker-compose up'd my project again, but connections to my container started failing. Looking at docker ps and lsof output I noticed that the published ports are listening on the VM IP, not the host. pinata list still shows networking to be set to hostnet however.

Expected behavior

Still in hostnet mode, published ports still visible on host after upgrade.

Actual behavior

Reverted to nat networking(?).

Information

The particular VPN client is Tunnelblick.

  • the output of:

    • pinata diagnose -u on OSX

    OS X: version 10.11.4 (build: 15E65)
    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/20160421-185637.tar.gz
    Most specific failure is: No error was detected
    Your unique id is: F68A8050-2593-4AD1-8E01-E9BFE38F55C3
    Please quote this in all correspondence.

Steps to reproduce the behavior

  1. Turn VPN off
  2. pinata set network hostnet
  3. docker-compose up something that publishes ports
  4. observe ports on localhost
  5. Upgrade Docker for Mac
  6. docker-compose up
  7. observe ports not on localhost

(Bradley Broom) #2

Looks like there is a new option in pinata “native/port-forwarding” that needs to be set to true


(Dave Scott) #3

That’s correct: it’s now possible to choose whether ports appear on localhost independently of whether traffic goes through the VPN proxy.

To expose ports on localhost in beta8, run

pinata set native/port-forwarding true

Note this will restart the internal VM and the containers.


(Ilkka Laukkanen) #4

Okay, that explains it then. Also a non-issue apparently because docker.local goes away completely in beta9. Thanks for the replies :slight_smile: