MCPcopy Create free account
hub / github.com/containerd/nerdctl / WithSysctls

Function WithSysctls

pkg/cmd/container/run_runtime.go:68–81  ·  view source on GitHub ↗

WithSysctls sets the provided sysctls onto the spec

(sysctls map[string]string)

Source from the content-addressed store, hash-verified

66
67// WithSysctls sets the provided sysctls onto the spec
68func WithSysctls(sysctls map[string]string) oci.SpecOpts {
69 return func(ctx context.Context, client oci.Client, c *containers.Container, s *specs.Spec) error {
70 if s.Linux == nil {
71 s.Linux = &specs.Linux{}
72 }
73 if s.Linux.Sysctl == nil {
74 s.Linux.Sysctl = make(map[string]string)
75 }
76 for k, v := range sysctls {
77 s.Linux.Sysctl[k] = v
78 }
79 return nil
80 }
81}

Callers 1

setPlatformOptionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…