bind for 0.0.0.0:27017 failed: port is already allocated. by what?

composedockerports6 replies · 143 views · started
  1. not gonna lie this is driving me nuts this worked fine last week. Today, on a fresh Ubuntu box, the web container dies right away:

    This app can't run on your PC

    This app can't run on your PC
    
    To find a version for your PC, check with the
    software publisher.
    

    i didnt change the compose file. Port 27017 lmao Ive checked Task Manager and htop and i cant find anything obvious. Is Docker keeping a ghost reservation?

    ive already run docker compose down in teh project folder, restarted Docker Desktop and checked that no other terminal is running the stack. the error comes back instantly every time. is there a command that just tells me who owns a port? pls help 🙏

    6
  2. Do u have other compose projects on a spare laptop? What does docker compose ls say? ??

    10 0 helpful
  3. lol same thing happened to me if docker-proxy itself holds the port after a crash, restarting the daemon (sudo systemctl restart docker) releases it. Check ps aux | grep docker-proxy first.

    0 10 helpful
  4. in CI, add a cleanup step that always runs: docker compose down -v --remove-orphans, and give each job a unique project name with -p sooo parallel jobs dont fight over the same names. better yet, dont publish fixed host ports in CI at all; let containers talk over the compose network.

    2 2 helpful
  5. For CI i'd go further than cleanup steps: run each job in a fresh runner VM so leftover state is impossible.

    5 0 helpful
  6. @unal592 Moved teh mapping to a port outside teh excluded range. Everything works on a fresh Ubuntu box now. Thanks for the netsh tip! cant believe it was that simple lol

    thumbsup

    1 3 helpful

Reply to this topic

Sign in or create an account to reply.