opencontainers / opencontainers/runc
Add validations `user.max_user_namespaces` and `kernel.pid_max` for rootless containers
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13.5k
- Forks
- 2.3k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 30
Description
Rootless containers need to create namespace in user space as the README already mentions. If one of,
user.max_user_namespaceskernel.pid_max
is zero, you end up with the following error:
Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:352: getting the final child's pid from pipe caused: EOF: unknown
The error say that I'm starving for namespaces or PIDs! To make UX better on this,
- we can validate both of variables from sysctl in runtime (ensure not zero)
- better error message:
user namespace starvation! consider increase user.max_user_namespaces
Test version: v1.0.0-rc93
Ref: https://github.com/moby/moby/issues/40835#issuecomment-730981130
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rootless-container guidance in README and the error path in libcontainer/process_linux.go, then inspect how sysctl values are accessed. Done means zero user.max_user_namespaces or kernel.pid_max values are detected and produce a clear remediation message, with coverage for both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100