Findings
It always failed on initialization with different modules enabled that would use up the available file descriptors. By the time the socket was to be bound, there were none left. I was stuck when trying to use lsof
in docker and gave up on that earlier because there are too many possibilities of what may be the cause of it not working. (see How can I substitute lsof inside a Docker (native, not LXC-based))
Finally a google search about file descriptor limits:
# uname -r
5.15.106-1-MANJARO
# ulimit -n
1024
And a helpful answer: https://stackoverflow.com/questions/24318543/ solved the issue for me.
Solution:
run docker with --ulimit
parameter
docker run --rm -p 8080:8080 --ulimit nofile=262144:262144 -ti mytag:latest bash
UPDATE:
According to this thread: https://github.com/moby/moby/issues/44547
a semi-permanent solution seems to be to change LimitNOFILE
value from infinity
to 1048576
in file /usr/lib/systemd/system/containerd.service
. You might have to repeat this after a system upgrade.
Another solution is outlined in this thread: https://bbs.archlinux.org/viewtopic.php?id=285058 where it is suggested to create a docker settings file in /etc/docker/daemon.json
to set the default ulimits for docker like so:
{
"default-ulimits": {
"nofile": {
"Hard": 1048576,
"Name": "nofile",
"Soft": 1048576
}
}
}
and then run systemctl reload docker
to apply the changes.