Add WithUserIDs SpecOpt

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2017-08-22 11:41:17 -04:00
parent f05281743e
commit ba69f5d488

View File

@ -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
}
}