Skip to content

Commit 18f8dd7

Browse files
author
Mrunal Patel
committed
Merge pull request #94 from Mashimiao/generate-add-cgroups-path-support
generate: add specified cgroups path support
2 parents 32c6e70 + afa3fce commit 18f8dd7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

generate.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ var generateFlags = []cli.Flag{
3838
cli.StringSliceFlag{Name: "tmpfs", Usage: "mount tmpfs"},
3939
cli.StringSliceFlag{Name: "args", Usage: "command to run in the container"},
4040
cli.StringSliceFlag{Name: "env", Usage: "add environment variable"},
41+
cli.StringFlag{Name: "cgroups-path", Usage: "specify the path to the cgroups"},
4142
cli.StringFlag{Name: "mount-cgroups", Value: "no", Usage: "mount cgroups (rw,ro,no)"},
4243
cli.StringSliceFlag{Name: "bind", Usage: "bind mount directories src:dest:(rw,ro)"},
4344
cli.StringSliceFlag{Name: "prestart", Usage: "path to prestart hooks"},
@@ -138,6 +139,7 @@ func modify(spec *rspec.Spec, context *cli.Context) error {
138139
spec.Process.Args = make([]string, 0)
139140
}
140141
spec.Process.SelinuxLabel = context.String("selinux-label")
142+
spec.Linux.CgroupsPath = sPtr(context.String("cgroups-path"))
141143
spec.Linux.MountLabel = context.String("mount-label")
142144
spec.Platform.OS = context.String("os")
143145
spec.Platform.Arch = context.String("arch")

man/ocitools-generate.1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ compatible runtime like runC to run a container.
4444
**--cap-drop**=[]
4545
Drop Linux capabilities
4646

47+
**--cgroups-path**=""
48+
Specifiy the path to the cgroups relative to the cgroups mount point.
49+
4750
**--cwd**=PATH
4851
Current working directory for the process
4952

0 commit comments

Comments
 (0)