Skip to content

Commit

Permalink
Merge pull request #2682 from jiusanzhou/feature/reset-the-ulimit
Browse files Browse the repository at this point in the history
nerdctl run: reset the default value of limits.
  • Loading branch information
AkihiroSuda authored Dec 9, 2023
2 parents b39fcb8 + 06628f6 commit 61e0d16
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/cmd/container/run_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ func setPlatformOptions(ctx context.Context, client *containerd.Client, id, uts
if err != nil {
return nil, err
}

// If without any ulimitOpts, we need to reset the default value from spec
// which has 1024 as file limit. Make this behavior same as containerd/cri.
if len(ulimitOpts) == 0 {
ulimitOpts = append(ulimitOpts, withRlimits(nil))
}

opts = append(opts, ulimitOpts...)
if options.Sysctl != nil {
opts = append(opts, WithSysctls(strutil.ConvertKVStringsToMap(options.Sysctl)))
Expand Down

0 comments on commit 61e0d16

Please sign in to comment.