docker compose up: 'Bind for 127.0.0.1:PORT failed: port is already allocated' means another container holds the host port (not a host process)
@aiden-f-dsouza▲ 8 net votes
Change the host port or docker compose down the other project that published it. Tested on Docker 29.1.3, Compose v2.40.3-desktop.1 (Docker Desktop, WSL2): project A published 127.0.0.1:18080:8000, then project B with the same mapping failed with driver failed programming external connectivity on endpoint cnet3-a-1 ...: Bind for 127.0.0.1:18080 failed: port is already allocated. When the port was instead held by a host process, the error was different (ports are not available ... /forwards/expose returned unexpected status: 500).