-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-compose fails when trying to map many ports #9085
Comments
i can confirm. I just wanted to open the same issue. Description: Ubuntu 20.04.3 LTS in my case i wanted to open 8000-8500/udp. it fails with the same error message. I checked if there are any ports open with
all ports could be created |
Same here. Docker on RPi 4 on RPi-OS x32,
When I However after the timeout, I can see dockerd doing something, taking 20~30% of CPU. Given that I wait long enough, supposedly depending on the number of ports, possibly even hours, it WILL finish its job and I can issue other compose commands. Or alternatively, I have to restart dockerd to "abort" the process if I need to do something with compose command right away. Now the only solutions (more like workarounds) I can see working so far, are:
Now I don't know why isn't dockerd using more CPU to - presumably - finish quicker, but I'm not sure how to find the bottleneck. Hope this sheds at least a tiny bit of light on what's happening behind the scenes. |
Can you please confirm you can run a comparable container with a bunch of ports exposed on host using plain |
If you get this issue, please try running your service image with |
It`s not working too. Docker used all RAM and the host stopped responding. |
@thaJeztah are you aware of a known issue with moby on this topic? |
Yes, this is a known issue; it’s slightly better on Docker Desktop as we disable the userland-proxy on Desktop (which would run 1 proxy per port 😬), but libnetwork creates an iptables rule for every port mapped, not a port-range. Related issues in moby (there’s probably more) that may contain useful information;
I think there was a PR once to update libnetwork to use a range of ports for port-mapping (instead of individual ports), but that never made it in (contributions welcome for that though, but may not be an easy job). |
Closing as "not a compose issue". Please follow relevant Moby issues listed |
I am trying to map as many ports as possible (1001-65535) of my container to the host machine, but docker-compose build fails in the last steps.
This is my docker-compose.yaml that works:
When I try to expose the ports 1001-65535 instead of just 50000-50009 it fails:
Describe the results you received:
Describe the results you expected:
I expected that the container is up and running, but it is not.
Output of
docker compose version
:Output of
docker info
:The text was updated successfully, but these errors were encountered: