Windows: publishing a port on a host IP (-p IP:port:port) fails with 'Address not available (os error 99)'; 0.0.0.0 is loopback-only

Aperta
#218 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start by tracing how published port host addresses are passed from the daemon into the WSL2 guest, then inspect the Windows-side forwarder kiri-win.exe and its listener configuration. The issue suggests either forwarding the requested host IP from Windows or changing how unspecified binds reach Windows interfaces; compare those paths and their existing tests. Done means a host-IP bind is reachable from another machine, or Windows reports clearly that published ports are loopback-only.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What you're trying to do

Publish a container port on a specific Windows host address, e.g. a VPN/overlay or LAN interface, so other machines on that network can reach it:

docker run -d -p 192.0.2.10:8080:80 nginx:alpine

Docker Desktop supports this: its Windows-side proxy binds the host address you give it. This is common in Compose files that use ${BIND_IP}:port:port to keep a service off other interfaces.

What happens on Kiri (0.2.0, Windows 11, WSL2 backend)

With a host IP that exists on Windows but not in the Kiri VM, the daemon fails the start:

docker: Error response from daemon: Address not available (os error 99)

os error 99 is EADDRNOTAVAIL, so the bind appears to happen inside the guest's network namespace, where the host address doesn't exist.

Other bind addresses:

-p host address Result
127.0.0.1:18081:80 Works, reachable from the Windows host only
0.0.0.0:18082:80 Container starts, but Windows only listens on 127.0.0.1:18082. Connecting via the host's LAN/overlay address is refused.
192.0.2.10:18080:80 (a real host interface address) Address not available (os error 99)

So a published port can never be reached from another machine, and a compose file that pins a bind address fails to start instead of falling back.

What you'd like Kiri to do

Either of these would cover it:

  1. Honour the host IP in -p IP:host:container by having the Windows-side forwarder (kiri-win.exe) listen on that address and forward to the guest, instead of passing the address to the guest.
  2. Make 0.0.0.0 / unspecified bind actually listen on all Windows interfaces, as Docker Desktop does, with an opt-in setting if you'd rather keep the loopback-only default.

If neither fits, a clear error that says published ports are loopback-only on Windows would help. The current message points at the wrong place.

Would you like to build it?

No, just suggesting it

Lingua principale
Rust
Stelle
7.5k
Fork
329
Merge medio
7h 48m
PR unite (30g)
105

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di libracoder/kiri

Tutte le issue di libracoder/kiri

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.