Repeated container port on non-loopback host IPs fails to start: failed to bind host port 127.0.0.1 (address already in use)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker
- Lĩnh vực
- networking
Hướng nghiên cứu
Start with the Docker Desktop network forwarder, since the report points to an internal loopback port bind failure during container networking; the issue does not name a source file or test. Reproduce with the docker run command and compare the listed host IP and repeated container port cases. Done means both mappings start and forward successfully on non-loopback host IPs.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Platform: macOS (arm64, macOS 27.0.1)
Bug description
Publishing the same container port more than once fails at container creation
when the host IP is a non-loopback address — including the case where both
publications use the same host IP. The daemon reports a 127.0.0.1:
port that was never requested, and which nothing is listening on.
Impact: a host with a primary and a secondary LAN address (e.g. en0 with
192.168.86.93 and an alias 192.168.86.15) cannot forward the same service port on
each address into the engine. Two services exposed as 192.168.86.93:8883 and
192.168.86.15:8883 — the normal way to give each its own identity — cannot both
be published. On Linux each binding gets its own proxy/DNAT rule and this works;
here container creation aborts.
Reproduction steps
Minimal, no application involved:
docker run -d --name t --entrypoint sleep \
-p 192.168.86.93:18883:8883 \
-p 192.168.86.93:18884:8883 \
python:3-alpine 60
Result:
docker: Error response from daemon: failed to set up container networking:
driver failed programming external connectivity on endpoint t (…): failed to
bind host port 127.0.0.1:55040/tcp: address already in use
The port in that message changes on every attempt (55009, 55019, 55040, 55071
observed). Neither 18883 nor 18884 is in use before the run, and nothing holds
the reported 127.0.0.1 port.
Same result with two different LAN addresses, with the same host port on both,
and via compose:
services:
t:
image: python:3-alpine
entrypoint: sleep
command: "60"
ports:
- "192.168.86.15:18883:8883"
- "192.168.86.93:18883:8883"
Matrix
All rows: python:3-alpine, 45–60s sleep, default bridge, same engine. Only the
last three rows fail.
| Publications | Container starts |
|---|---|
18883:8883 + 18884:8884 (wildcard, distinct container ports) |
yes |
18883:8883 + 18884:8883 (wildcard, same container port) |
yes |
127.0.0.1:18883:8883 + 127.0.0.1:18884:8883 (loopback twice) |
yes |
192.168.86.93:18883:8883 + 127.0.0.1:18884:8883 (LAN + loopback) |
yes |
192.168.86.93:18883:8883 + 192.168.86.93:18884:8884 (same LAN IP, distinct container ports) |
yes |
192.168.86.93:18883:8883 + 192.168.86.93:18884:8883 (same LAN IP, same container port) |
no |
192.168.86.15:18883:8883 + 192.168.86.93:18884:8883 (two LAN IPs, same container port) |
no |
192.168.86.15:18883:8883 + 192.168.86.93:18883:8883 (two LAN IPs, same host and container port) |
no |
The trigger is a repeated container port combined with a non-loopback host IP, on
the same address or different ones. Different container ports on the same host IP
are fine, so it is not "two explicit bindings" in general.
This is not port exhaustion on the host: the macOS ephemeral range is the default
49152–65535, the machine has 33 listening TCP sockets, and com.docker.backend
holds ~247 TCP sockets at rest.
Expected behavior
Both mappings are active — each host address forwards to the container port, as
they do on a Linux engine.
Actual behavior
docker run returns an error and the container is not created. The message names
an internal loopback port and an EADDRINUSE on it, which points at the port
forwarder rather than the requested bindings.
Possibly related
#817 reports that on macOS a binding to a specific (loopback alias) IP silently
becomes 0.0.0.0, where it previously worked — different symptom, but if both are
regressions they may sit in the same part of the forwarder.
Diagnostics
I can generate a diagnostics ID from the app and attach it, and retest after
resetting Docker Desktop's network settings or on a clean install, if the
reproduction does not trigger in your environment.
Version information
Client:
Version: 29.9.3
API version: 1.56
Go version: go1.26.10
Git commit: 5457199
Built: Tue Nov 3 21:41:57 2026
OS/Arch: darwin/arm64
Context: desktop-linux
Server: Docker Desktop 4.99.0 (245822)
Engine:
Version: 29.9.3
API version: 1.56 (minimum version 1.40)
Go version: go1.26.10
Git commit: 70efc0e
Built: Tue Nov 3 21:41:25 2026
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: v2.4.2
runc:
Version: 1.5.2
macOS 27.0.1, Apple silicon, default bridge network, default daemon config.
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 53
- Fork
- 24
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/desktop-feedback
-
Codex sandbox template seeds MCP gateway config with keys Codex does not recognize (type, headers)Đang mởplatform/macos
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
docker/desktop-feedback#721 ·
-
Location: /home/linuxbrewĐang mởkind/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
docker/desktop-feedback#259 ·
-
kind/bug platform/windows
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
docker/desktop-feedback#862 ·
-
kind/bug platform/windows
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 45/100
docker/desktop-feedback#861 ·
-
kind/bug platform/macos
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
docker/desktop-feedback#860 ·
Tất cả issue của docker/desktop-feedback
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
on_ctrl_redirect(): iterator never advances — infinite loop stalls the event loop at 100% CPUĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
openziti/ziti-sdk-c#1254 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
modem: ppp: CMUX DLCI receive buffer overruns on large downlink packetsCó thể đã có người làm @pedrohqr đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
zephyrproject-rtos/zephyr#126195 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày