diff --git a/apis/swagger.yml b/apis/swagger.yml index 4df034c99..f3cfd2f1b 100644 --- a/apis/swagger.yml +++ b/apis/swagger.yml @@ -1964,6 +1964,10 @@ definitions: QuotaID: type: "string" description: "set disk quota by specified quota id, if id < 0, it means pouchd alloc a unique quota id" + NetPriority: + description: "net priority." + type: "integer" + default: 0 ContainerCreateResp: description: "response returned by daemon when container create successfully" diff --git a/apis/types/container_config.go b/apis/types/container_config.go index b2193788b..87c96a75c 100644 --- a/apis/types/container_config.go +++ b/apis/types/container_config.go @@ -73,6 +73,9 @@ type ContainerConfig struct { // MAC address of the container. MacAddress string `json:"MacAddress,omitempty"` + // net priority. + NetPriority int64 `json:"NetPriority,omitempty"` + // Disable networking for the container. NetworkDisabled bool `json:"NetworkDisabled,omitempty"` @@ -151,6 +154,8 @@ type ContainerConfig struct { /* polymorph ContainerConfig MacAddress false */ +/* polymorph ContainerConfig NetPriority false */ + /* polymorph ContainerConfig NetworkDisabled false */ /* polymorph ContainerConfig OnBuild false */ diff --git a/cli/common_flags.go b/cli/common_flags.go index 02b35bcb2..8f6869b67 100644 --- a/cli/common_flags.go +++ b/cli/common_flags.go @@ -95,6 +95,7 @@ func addCommonFlags(flagSet *pflag.FlagSet) *container { flagSet.StringVar(&c.richMode, "rich-mode", "", "Choose one rich container mode. dumb-init(default), systemd, sbin-init") flagSet.StringVar(&c.initScript, "initscript", "", "Initial script executed in container") flagSet.StringVar(&c.shmSize, "shm-size", "", "Size of /dev/shm, default value is 64MB") + flagSet.Int64Var(&c.netPriority, "net-priority", 0, "net priority") // cgroup flagSet.StringVarP(&c.cgroupParent, "cgroup-parent", "", "", "Optional parent cgroup for the container") diff --git a/cli/container.go b/cli/container.go index 479eb7e59..2836f5160 100644 --- a/cli/container.go +++ b/cli/container.go @@ -72,6 +72,7 @@ type container struct { ulimit Ulimit pidsLimit int64 shmSize string + netPriority int64 // log driver and log option logDriver string @@ -203,6 +204,7 @@ func (c *container) config() (*types.ContainerCreateConfig, error) { DiskQuota: diskQuota, QuotaID: c.quotaID, SpecAnnotation: specAnnotation, + NetPriority: c.netPriority, }, HostConfig: &types.HostConfig{