-
Notifications
You must be signed in to change notification settings - Fork 123
Original ip is not passed to containers #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Isn't that expected behavior? Since you're not passing any network flag the container is using the default bridge mode. So you're seeing the container's IP address on the docker0 bridged interface. |
No, I should see the remote ip (like in linux or docker toolbox) of the connected machine from inside the container, and not the container's gateway ip. |
This is a pretty serious issue as NAT appears to be broken ... kind of a deal breaker. |
I confirm that I can reproduce the issue. I will discuss the issue further with the team to see what we can do to fix it. |
I also confirm that we can reproduce the issue on Linux, so the issue is not in Docker for Mac. /cc @thaJeztah is it a know issue on Linux? |
I had second thoughts about whether I had really reproduced on native Linux. I had done a In the for-mac case the 172.17.0.1 is not going to be an address which the OSX host knows about, which is the crux of the issue here since something which ought to dial back to the mac will end up dailing back to the VM hosting the containers instead. So I think I was too quick to tell @samoht I was seeing the same issue on native Linux, sorry. Reopening. I think what would be needed here would be some mechanism to forward ports back out of the VM to the host (i.e. the inverse of what |
@samoht @ijc25 I know there's an issue in swarm mode (see moby/moby#25526) |
I tried to replicate the issue and found out that the IP address like This behavior is for standalone container. For swarm mode, it is another separate issue. |
@PanJ in that case, I suspect it's because of the userland-proxy |
@thaJeztah |
Thanks for the report and sorry the delay! I have forwarded the issue to our networking team, we will keep you updated when we start making progress on fixing that issue. |
I think making this just work in Docker for Mac will be quite involved. We can't add an
As a workaround in the meantime perhaps you could run an explicit HTTP proxy container yourself, and make it add the |
@djs55 for what it's worth, this also appears to happen with Docker Swarm mode ... |
This makes it impossible to test things like HAproxy load balancing via |
@samoht Just checking on the status of this. The issue is over a year old and doesn't sound like it's being actively reviewed in the last 9 months. Can we get a status update? Please. |
this configuration worked for me
changing port bind mode to host how ever you should force your fronted container to run on the specific host in swarm cluster only i.e. |
this works for me:
Note the addition of |
As this is the docker for mac repository: https://docs.docker.com/network/network-tutorial-host/
|
I'm not sure if this helps, but I am experiencing this issue on CentOS 8 with DockerCE. |
Those solutions above only work on Linux.
I wanted to run Tomcat Docker on a Windows host, only to find out that I cannot access the management interface. By default, it is only accessible from localhost as a security measure. So my only option afaik is to reconfigure Tomcat and compromise my apps security. |
Same here On Mac OSX 10.14.6 On a remote machine Expected to be the ip from remote client on 192.168.25.0 network |
As a reply to my crosspost to boot2docker I‘ve got the hint to put this problem/wish on the roadmap at https://github.com/docker/roadmap |
So, we're in August, can't we have a solution from docker team? I just want to have the original ip forwarded to containers :/ |
Same for me. Can we have the original IP forwarded? 😁 🙏 |
Thanks. Worked for me. |
Yeah we know that. But host mode only circumvents the problem. |
Same for me... |
Yep, same here on Linux aswell |
Still an issue in Docker Desktop in Windows 10. This prevents setting up ACL in web based applications hosted inside a Docker container. This should be marked critical and have a proper fix. |
This issue has prevented me from using my applications in production. Is this in the "Roadmap" anywhere? |
This feature request has now moved to docker/roadmap#157, so I'm going to close this ticket. |
It helps but the performance is going so bad from 19ms to 2-3seconds |
This worked for me and performance wasn't degraded at all. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
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
HOST: docker run --rm --name nginx-test -p 8080:80 nginx
HOST: curl localhost:8080
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).
The text was updated successfully, but these errors were encountered: