Skip to content

Commit 39db888

Browse files
committed
add support for build.privileged and service.cgroup
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent ecbc28d commit 39db888

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

schema/compose-spec.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"shm_size": {"type": ["integer", "string"]},
103103
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
104104
"isolation": {"type": "string"},
105+
"privileged": {"type": "boolean"},
105106
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
106107
"tags": {"type": "array", "items": {"type": "string"}},
107108
"platforms": {"type": "array", "items": {"type": "string"}}
@@ -407,9 +408,7 @@
407408
{"type": "string"}
408409
]
409410
},
410-
"mode": {
411-
"type": "number"
412-
}
411+
"mode": {"type": "number"}
413412
},
414413
"additionalProperties": false,
415414
"patternProperties": {"^x-": {}}
@@ -581,12 +580,12 @@
581580
"items": {
582581
"type": "object",
583582
"properties": {
584-
"capabilities": {"$ref": "#/definitions/list_of_strings"},
585-
"count": {"type": ["string", "integer"]},
586-
"device_ids": {"$ref": "#/definitions/list_of_strings"},
587-
"driver":{"type": "string"},
588-
"options":{"$ref": "#/definitions/list_or_dict"}
589-
},
583+
"capabilities": {"$ref": "#/definitions/list_of_strings"},
584+
"count": {"type": ["string", "integer"]},
585+
"device_ids": {"$ref": "#/definitions/list_of_strings"},
586+
"driver":{"type": "string"},
587+
"options":{"$ref": "#/definitions/list_or_dict"}
588+
},
590589
"additionalProperties": false,
591590
"patternProperties": {"^x-": {}}
592591
}

types/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ type ServiceConfig struct {
9393
CapAdd []string `mapstructure:"cap_add" yaml:"cap_add,omitempty" json:"cap_add,omitempty"`
9494
CapDrop []string `mapstructure:"cap_drop" yaml:"cap_drop,omitempty" json:"cap_drop,omitempty"`
9595
CgroupParent string `mapstructure:"cgroup_parent" yaml:"cgroup_parent,omitempty" json:"cgroup_parent,omitempty"`
96+
Cgroup string `mapstructure:"cgroup" yaml:"cgroup,omitempty" json:"cgroup,omitempty"`
9697
CPUCount int64 `mapstructure:"cpu_count" yaml:"cpu_count,omitempty" json:"cpu_count,omitempty"`
9798
CPUPercent float32 `mapstructure:"cpu_percent" yaml:"cpu_percent,omitempty" json:"cpu_percent,omitempty"`
9899
CPUPeriod int64 `mapstructure:"cpu_period" yaml:"cpu_period,omitempty" json:"cpu_period,omitempty"`
@@ -319,6 +320,7 @@ type BuildConfig struct {
319320
Secrets []ServiceSecretConfig `yaml:",omitempty" json:"secrets,omitempty"`
320321
Tags StringList `mapstructure:"tags" yaml:"tags,omitempty" json:"tags,omitempty"`
321322
Platforms StringList `mapstructure:"platforms" yaml:"platforms,omitempty" json:"platforms,omitempty"`
323+
Privileged bool `yaml:",omitempty" json:"privileged,omitempty"`
322324

323325
Extensions map[string]interface{} `yaml:",inline" json:"-"`
324326
}

0 commit comments

Comments
 (0)