-
Notifications
You must be signed in to change notification settings - Fork 717
Default net.ipv4.ip_unprivileged_port_start to 0 inside containers #4615
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
base: main
Are you sure you want to change the base?
Default net.ipv4.ip_unprivileged_port_start to 0 inside containers #4615
Conversation
pkg/cmd/container/create.go
Outdated
| opts = append(opts, umaskOpts...) | ||
|
|
||
| if !isHostNetwork(netLabelOpts) { | ||
| opts = append(opts, withDefaultUnprivilegedPortSysctl(options.Sysctl)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conflicts with:
nerdctl/pkg/cmd/container/run_linux.go
Line 100 in 1d69ed9
| opts = append(opts, WithSysctls(strutil.ConvertKVStringsToMap(options.Sysctl))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the defaulting for net.ipv4.ip_unprivileged_port_start in create.go, building on top of the behavior in run_linux.go. Does this still conflict?
|
Please fix the lint errors, squash the commits, and sign off the DCO |
…iners Signed-off-by: Yash Kukrecha <ykukrecha@gmail.com>
9d214b1 to
56f05ed
Compare
This PR makes nerdctl default the container's
net.ipv4.ip_unprivileged_port_startsysctl to0, unless the user has explicitly set this sysctl via--sysctl.Key changes:
withDefaultUnprivilegedPortSysctlinpkg/cmd/container/container.go.--sysctlfornet.ipv4.ip_unprivileged_port_start, nerdctl does not override it.Note: Host-wide sysctl configuration and containerd-rootless-setuptool.sh were intentionally left unchanged in this PR to keep the scope focused on the container namespace default requested in the issue.
Fixes #4595