Skip to content

Original ip is not passed to containers #180

Closed
@withinboredom

Description

Expected behavior

See my real ip (or an X-FORWARDED-FOR header): ex: 10.100.2.14

Actual behavior

Instead I see 172.19.0.1, which is not my host's ip.

Information

Diagnostic ID: 70CE1D3C-D5A6-4C95-ABA8-17CEF9371D01
Docker for Mac: 1.12.0 (Build 10871)
macOS: Version 10.11.6 (Build 15G31)
[OK] docker-cli
[OK] app
[OK] moby-syslog
[OK] disk
[OK] virtualization
[OK] system
[OK] menubar
[OK] osxfs
[OK] db
[OK] slirp
[OK] moby-console
[OK] logs
[OK] vmnetd
[OK] env
[OK] moby
[OK] driver.amd64-linux

Steps to reproduce the behavior

  1. HOST: docker run --rm --name nginx-test -p 8080:80 nginx
  2. HOST: curl localhost:8080
  3. You'll see an ip in the logs with something like 172.17.0.1, take note of that.

This is not the ip address of the actual machine that made the call. For debuggers that call back to the originating ip (such as php xdebug) this means docker cannot be used to debug anything. I would expect to see an IP of the original machine (such as a truly remote host).

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions