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 tags in the build section #256

Merged
merged 1 commit into from
May 13, 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
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ services:
uid: '103'
gid: '103'
mode: 0440
tags:
- foo:v1.0.0
- docker.io/username/foo:my-other-tag


cap_add:
Expand Down
8 changes: 8 additions & 0 deletions loader/full-struct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
Mode: uint32Ptr(0440),
},
},
Tags: []string{"foo:v1.0.0", "docker.io/username/foo:my-other-tag"},
},
CapAdd: []string{"ALL"},
CapDrop: []string{"NET_ADMIN", "SYS_ADMIN"},
Expand Down Expand Up @@ -598,6 +599,9 @@ services:
uid: "103"
gid: "103"
mode: 288
tags:
- foo:v1.0.0
- docker.io/username/foo:my-other-tag
cap_add:
- ALL
cap_drop:
Expand Down Expand Up @@ -1127,6 +1131,10 @@ func fullExampleJSON(workingDir, homeDir string) string {
"gid": "103",
"mode": 288
}
],
"tags": [
"foo:v1.0.0",
"docker.io/username/foo:my-other-tag"
]
},
"cap_add": [
Expand Down
3 changes: 2 additions & 1 deletion schema/compose-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
"shm_size": {"type": ["integer", "string"]},
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
"isolation": {"type": "string"},
"secrets": {"$ref": "#/definitions/service_config_or_secret"}
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
"tags": {"type": "array", "items": {"type": "string"}}
},
"additionalProperties": false,
"patternProperties": {"^x-": {}}
Expand Down
1 change: 1 addition & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ type BuildConfig struct {
Network string `yaml:",omitempty" json:"network,omitempty"`
Target string `yaml:",omitempty" json:"target,omitempty"`
Secrets []ServiceSecretConfig `yaml:",omitempty" json:"secrets,omitempty"`
Tags StringList `mapstructure:"tags" yaml:"tags,omitempty" json:"tags,omitempty"`

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