diff --git a/spec_opts_unix.go b/spec_opts_unix.go index 3e35c18c8..a2a040a0e 100644 --- a/spec_opts_unix.go +++ b/spec_opts_unix.go @@ -289,3 +289,12 @@ func WithNamespacedCgroup(ctx context.Context, id string) SpecOpts { return nil } } + +// WithUserIDs allows the UID and GID for the Process to be set +func WithUserIDs(uid, gid uint32) SpecOpts { + return func(s *specs.Spec) error { + s.Process.User.UID = uid + s.Process.User.GID = gid + return nil + } +}