diff --git a/loader/full-example.yml b/loader/full-example.yml index 2687b05f..cb300c9f 100644 --- a/loader/full-example.yml +++ b/loader/full-example.yml @@ -26,6 +26,9 @@ services: - foo:v1.0.0 - docker.io/username/foo:my-other-tag - ${COMPOSE_PROJECT_NAME}:1.0.0 + platforms: + - linux/amd64 + - linux/arm64 cap_add: diff --git a/loader/full-struct_test.go b/loader/full-struct_test.go index c3c7260e..c339c4c7 100644 --- a/loader/full-struct_test.go +++ b/loader/full-struct_test.go @@ -70,7 +70,8 @@ func services(workingDir, homeDir string) []types.ServiceConfig { Mode: uint32Ptr(0o440), }, }, - Tags: []string{"foo:v1.0.0", "docker.io/username/foo:my-other-tag", "full_example_project_name:1.0.0"}, + Tags: []string{"foo:v1.0.0", "docker.io/username/foo:my-other-tag", "full_example_project_name:1.0.0"}, + Platforms: []string{"linux/amd64", "linux/arm64"}, }, CapAdd: []string{"ALL"}, CapDrop: []string{"NET_ADMIN", "SYS_ADMIN"}, @@ -605,6 +606,9 @@ services: - foo:v1.0.0 - docker.io/username/foo:my-other-tag - full_example_project_name:1.0.0 + platforms: + - linux/amd64 + - linux/arm64 cap_add: - ALL cap_drop: @@ -1140,6 +1144,10 @@ func fullExampleJSON(workingDir, homeDir string) string { "foo:v1.0.0", "docker.io/username/foo:my-other-tag", "full_example_project_name:1.0.0" + ], + "platforms": [ + "linux/amd64", + "linux/arm64" ] }, "cap_add": [ diff --git a/schema/compose-spec.json b/schema/compose-spec.json index 2500ce75..d444e71d 100644 --- a/schema/compose-spec.json +++ b/schema/compose-spec.json @@ -103,7 +103,8 @@ "extra_hosts": {"$ref": "#/definitions/list_or_dict"}, "isolation": {"type": "string"}, "secrets": {"$ref": "#/definitions/service_config_or_secret"}, - "tags": {"type": "array", "items": {"type": "string"}} + "tags": {"type": "array", "items": {"type": "string"}}, + "platforms": {"type": "array", "items": {"type": "string"}} }, "additionalProperties": false, "patternProperties": {"^x-": {}} diff --git a/types/types.go b/types/types.go index fc5ac956..cff5ce83 100644 --- a/types/types.go +++ b/types/types.go @@ -306,6 +306,7 @@ type BuildConfig struct { Target string `yaml:",omitempty" json:"target,omitempty"` Secrets []ServiceSecretConfig `yaml:",omitempty" json:"secrets,omitempty"` Tags StringList `mapstructure:"tags" yaml:"tags,omitempty" json:"tags,omitempty"` + Platforms StringList `mapstructure:"platforms" yaml:"platforms,omitempty" json:"platforms,omitempty"` Extensions map[string]interface{} `yaml:",inline" json:"-"` }