Docker Desktop for Windows: cannot access service on exposed port in windows container mode

前端 未结 4 2207
隐瞒了意图╮
隐瞒了意图╮ 2021-02-19 04:09

I am using the following Dockerfiles to create a container running Jenkins in a windows container on Windows 10 desktop running Docker Desktop for Windo

4条回答
  •  甜味超标
    2021-02-19 05:02

    This is a currently a known issue on Windows. It's not possible to access a container endpoint from its own host using localhost/127.0.0.1. It is possible using Linux containers today because Docker has included a special workaround that is unique to their Moby/Linux implementation for running Linux containers on Windows.

    We're working on a fix for this, but today we recommend working around this by either:

    • Accessing container endpoints from a separate host, using the IP address of the host that is running the container, and the exposed port for the container on its host
    • OR by accessing the container on the same host, using the container's internal IP address and published port (you can use docker network inspect or docker exec ipconfig> to get the IP address of the container endpoint itself)

提交回复
热议问题