Add cpu and memory limits

Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
Ulysses Souza 2020-06-24 09:44:47 +02:00
parent b84be73ce7
commit 0a57fd7d5c
5 changed files with 47 additions and 9 deletions

View file

@ -44,6 +44,8 @@ func Command() *cobra.Command {
cmd.Flags().StringArrayVarP(&opts.Labels, "label", "l", []string{}, "Set meta data on a container")
cmd.Flags().StringArrayVarP(&opts.Volumes, "volume", "v", []string{}, "Volume. Ex: user:key@my_share:/absolute/path/to/target")
cmd.Flags().BoolP("detach", "d", true, "Run container in background and print container ID")
cmd.Flags().Float64Var(&opts.Cpus, "cpus", 1., "Number of CPUs")
cmd.Flags().VarP(&opts.Memory, "memory", "m", "Memory limit")
return cmd
}