Docker Desktop on Windows 10 stops working using IP address after "a while"

I am running a number of web applications on Docker Desktop on Windows 10, using WSL2.

After a while, usually around a day, all the containers stop being accessible using my servers IP. All the containers are still running and can be accessed from the server using localhost. Other apps on the server not in Docker remain accessible, only Docker containers are affected.

Restarting the container fixes it. All containers are affected at the same time. Nothing in the Event Logs of Windows suggests any trend. No updates, no restarts, nothing. Other than the containers not being accessible over the IP, everything looks fine.

This happens about once a day. But not exactly. For example, the last time was after about 30 hours. I’ve just restarted now so I expect them to all die again sometime tomorrow.

I’ve completely uninstalled Docker and WLS2 (Ubuntu), and even burned down some containers to start from scratch. Still happens, to all containers at the same time.

I’m completely stumped.

check the host file, you need to use host.docker.internal , exactly I don’t your issue but for me IP or localhost is not working when I communicate the service between container to container, so I checked my host file and I saw few entries for host/gateway, so I used host.docker.internal instead of localhost/ip.

Thanks