Add WithUserIDs SpecOpt
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
f05281743e
commit
ba69f5d488
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user