Skip to content

Commit c5ea95b

Browse files
authored
Merge pull request #282 from AkihiroSuda/build-platforms
2 parents 1656887 + 8cf4f0b commit c5ea95b

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

loader/full-example.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ services:
2626
- foo:v1.0.0
2727
- docker.io/username/foo:my-other-tag
2828
- ${COMPOSE_PROJECT_NAME}:1.0.0
29+
platforms:
30+
- linux/amd64
31+
- linux/arm64
2932

3033

3134
cap_add:

loader/full-struct_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
7070
Mode: uint32Ptr(0o440),
7171
},
7272
},
73-
Tags: []string{"foo:v1.0.0", "docker.io/username/foo:my-other-tag", "full_example_project_name:1.0.0"},
73+
Tags: []string{"foo:v1.0.0", "docker.io/username/foo:my-other-tag", "full_example_project_name:1.0.0"},
74+
Platforms: []string{"linux/amd64", "linux/arm64"},
7475
},
7576
CapAdd: []string{"ALL"},
7677
CapDrop: []string{"NET_ADMIN", "SYS_ADMIN"},
@@ -605,6 +606,9 @@ services:
605606
- foo:v1.0.0
606607
- docker.io/username/foo:my-other-tag
607608
- full_example_project_name:1.0.0
609+
platforms:
610+
- linux/amd64
611+
- linux/arm64
608612
cap_add:
609613
- ALL
610614
cap_drop:
@@ -1140,6 +1144,10 @@ func fullExampleJSON(workingDir, homeDir string) string {
11401144
"foo:v1.0.0",
11411145
"docker.io/username/foo:my-other-tag",
11421146
"full_example_project_name:1.0.0"
1147+
],
1148+
"platforms": [
1149+
"linux/amd64",
1150+
"linux/arm64"
11431151
]
11441152
},
11451153
"cap_add": [

schema/compose-spec.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
104104
"isolation": {"type": "string"},
105105
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
106-
"tags": {"type": "array", "items": {"type": "string"}}
106+
"tags": {"type": "array", "items": {"type": "string"}},
107+
"platforms": {"type": "array", "items": {"type": "string"}}
107108
},
108109
"additionalProperties": false,
109110
"patternProperties": {"^x-": {}}

types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ type BuildConfig struct {
306306
Target string `yaml:",omitempty" json:"target,omitempty"`
307307
Secrets []ServiceSecretConfig `yaml:",omitempty" json:"secrets,omitempty"`
308308
Tags StringList `mapstructure:"tags" yaml:"tags,omitempty" json:"tags,omitempty"`
309+
Platforms StringList `mapstructure:"platforms" yaml:"platforms,omitempty" json:"platforms,omitempty"`
309310

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

0 commit comments

Comments
 (0)