Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of platforms in the build section #282

Merged
merged 1 commit into from Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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(0440),
},
},
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