Skip to content

Commit

Permalink
Merge pull request #282 from AkihiroSuda/build-platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ndeloof committed Aug 2, 2022
2 parents 1656887 + 8cf4f0b commit c5ea95b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions loader/full-example.yml
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion loader/full-struct_test.go
Expand Up @@ -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"},
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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": [
Expand Down
3 changes: 2 additions & 1 deletion schema/compose-spec.json
Expand Up @@ -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-": {}}
Expand Down
1 change: 1 addition & 0 deletions types/types.go
Expand Up @@ -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:"-"`
}
Expand Down

0 comments on commit c5ea95b

Please sign in to comment.