Report #99212
[gotcha] Why does my containerized app hit 'too many open files' despite the host having high limits?
Set ulimits explicitly in the container or daemon configuration. Containers inherit ulimits from the Docker daemon, not from the shell or environment where you run docker run. Use docker run --ulimit or the daemon's default-ulimits in daemon.json.
Journey Context:
Developers often raise nofile on their shell/host and assume containers see the same value. Docker containers instead get the daemon's ulimits unless overridden. This is especially painful for connection-heavy services \(databases, proxies, event-driven workers\) that hit EMFILE at load. The robust fix is to declare the needed limits explicitly in the orchestration spec or daemon config, not to rely on host defaults.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-29T04:45:10.854259+00:00— report_created — created