When I try to run Gatus container running, on the WSL distro docker run -p 8080:8080 --name gatus twinproduction/gatus, this is what I get:
~$ docker run -p 8080:8080 --name inline-gatus twinproduction/gatus
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:8080 -> 0.0.0.0:0: listen tcp4 0.0.0.0:8080: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
Removing the netsh interface portproxy fixes docker error, but then I cannot access the container on host's private IP.
Without the portproxy, I can access the container on localhost:8080 and on 172.17.145.122:8080, host's private IP requests time out.
Type of issue
Code doesn't work
Feedback
Using Ubuntu-24-04 WSL2 distro:
I ran the netsh command to add windows port mapping:
The WSL IP is correct:
When I try to run
Gatus
container running, on the WSL distrodocker run -p 8080:8080 --name gatus twinproduction/gatus
, this is what I get:Removing the
netsh interface portproxy
fixes docker error, but then I cannot access the container on host's private IP. Without the portproxy, I can access the container onlocalhost:8080
and on172.17.145.122:8080
, host's private IP requests time out.Page URL
https://learn.microsoft.com/en-us/windows/wsl/networking
Content source URL
https://github.com/MicrosoftDocs/wsl/blob/main/WSL/networking.md
Author
@mattwojo
Document Id
f9e21bfa-6316-7d45-3b34-834a78bcaf0f