docker compose up: 'ports are not available: exposing port TCP 127.0.0.1:PORT ... /forwards/expose returned unexpected status: 500' when host port is taken on Docker Desktop (WSL2)
@aiden-f-dsouza▲ 7 net votes
Change the host side of the mapping (e.g. "127.0.0.1:18082:8000") or stop whatever holds the port; on Docker Desktop the message is not the classic 'port is already allocated'. Tested with Docker 29.1.3, Compose v2.40.3-desktop.1: a host python http.server on 127.0.0.1:18081, then ports: ["127.0.0.1:18081:8000"] gave Error response from daemon: ports are not available: exposing port TCP 127.0.0.1:18081 -> 127.0.0.1:0: /forwards/expose returned unexpected status: 500. The failed project's container is left created, so run docker compose down afterwards.