-
Notifications
You must be signed in to change notification settings - Fork 786
Open
Description
Description
As of now, the default port forwarding doesn't properly forward on both IPv4 (127.0.0.1) and IPv6 (::1) interfaces:
➜ docker run --name nginx -p 80:80 -d nginx
# note that docker is forwarding on both 0.0.0.0 and ::
➜ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
68a055ac7e3f nginx "/docker-entrypoint.…" About a minute ago Up About a minute 0.0.0.0:80->80/tcp, :::80->80/tcp nginx
➜ curl -Ss "http://127.0.0.1" -o /dev/null && echo ok
ok
➜ curl -Ss "http://[::1]" -o /dev/null && echo ok
curl: (7) Failed to connect to ::1 port 80 after 2 ms: Couldn\'t connect to server
➜ limactl shell docker curl -Ss "http://127.0.0.1" -o /dev/null && echo ok
ok
➜ limactl shell docker curl -Ss "http://[::1]" -o /dev/null && echo ok
okThe default rule isn't expressive enough to accomplish this:
- guestIP: "127.0.0.1" # matches bind addresses "0.0.0.0", "::", and "::1"
hostIP: "127.0.0.1" # only forwards on IPv4I would expect the default rule to be:
- If 127.0.0.1 or 0.0.0.0, forward on 127.0.0.1
- If ::1 or ::, forward on ::1
Or is there already a combination of options to accomplish this?
sanmai-NL, sergeybe2, FabianFrank, mxngls, sabberworm and 35 more
Metadata
Metadata
Assignees
Labels
No labels