Rootless Docker with slirp4netns show a docker IP instead of a client IP #45742
Labels
area/networking
area/rootless
Rootless mode
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
status/0-triage
version/24.0
Description
Actually there is a similar closed issue 45096 which has been moved to a discussion due to that reason.
We are thinking that this is not related to Traefik specific issue because the problem exists if you run haproxy, httpd or nginx applications and it is related how you run the docker container.
Reproduce
It works if you run the following docker container:
but it returns docker internal IP, if you run the same docker container with a Server IP:
Expected behavior
Rootless Docker with slirp4netns to show client IP's instead of Docker internal IP's.
We would like to be able to expose an application to a specific Server ip and not to all of them (0.0.0.0).
docker version
Client: Docker Engine - Community Version: 24.0.2 API version: 1.43 Go version: go1.20.4 Git commit: cb74dfc Built: Thu May 25 21:53:24 2023 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 24.0.2 API version: 1.43 (minimum version 1.12) Go version: go1.20.4 Git commit: 659604f Built: Thu May 25 21:51:50 2023 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.21 GitCommit: 3dce8eb055cbb6872793272b4f20ed16117344f8 runc: Version: 1.1.7 GitCommit: v1.1.7-0-g860f061 docker-init: Version: 0.19.0 GitCommit: de40ad0 rootlesskit: Version: 1.1.0 ApiVersion: 1.1.1 NetworkDriver: slirp4netns PortDriver: slirp4netns StateDir: /tmp/rootlesskit18755427 slirp4netns: Version: 1.2.0 GitCommit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
docker info
Additional Info
After checking slirp4netns there is an option (--outbound-addr) to define preferred outbound ipv4/ipv6 addresses or interface names.
Could we provide an environment variable for dockerd-rootless.sh script like
DOCKERD_ROOTLESS_ROOTLESSKIT_OUTBOUND_ADDR
so to be able to define an ip address/network interface ?Could we use/check pasta network driver because it handles differently the network interfaces and this probably fixes the exact problem with the Docker Internal IP instead of the client IP.
The text was updated successfully, but these errors were encountered: