Skip to content

Commit cc08edd

Browse files
committed
Add support of tags in the build section
Signed-off-by: Guillaume Lours <[email protected]>
1 parent bdac2d1 commit cc08edd

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

loader/full-example.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ services:
2222
uid: '103'
2323
gid: '103'
2424
mode: 0440
25+
tags:
26+
- foo:v1.0.0
27+
- docker.io/username/foo:my-other-tag
2528

2629

2730
cap_add:

loader/full-struct_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
7070
Mode: uint32Ptr(0440),
7171
},
7272
},
73+
Tags: []string{"foo:v1.0.0", "docker.io/username/foo:my-other-tag"},
7374
},
7475
CapAdd: []string{"ALL"},
7576
CapDrop: []string{"NET_ADMIN", "SYS_ADMIN"},
@@ -598,6 +599,9 @@ services:
598599
uid: "103"
599600
gid: "103"
600601
mode: 288
602+
tags:
603+
- foo:v1.0.0
604+
- docker.io/username/foo:my-other-tag
601605
cap_add:
602606
- ALL
603607
cap_drop:
@@ -1127,6 +1131,10 @@ func fullExampleJSON(workingDir, homeDir string) string {
11271131
"gid": "103",
11281132
"mode": 288
11291133
}
1134+
],
1135+
"tags": [
1136+
"foo:v1.0.0",
1137+
"docker.io/username/foo:my-other-tag"
11301138
]
11311139
},
11321140
"cap_add": [

schema/compose-spec.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@
102102
"shm_size": {"type": ["integer", "string"]},
103103
"extra_hosts": {"$ref": "#/definitions/list_or_dict"},
104104
"isolation": {"type": "string"},
105-
"secrets": {"$ref": "#/definitions/service_config_or_secret"}
105+
"secrets": {"$ref": "#/definitions/service_config_or_secret"},
106+
"tags": {"type": "array", "items": {"type": "string"}}
106107
},
107108
"additionalProperties": false,
108109
"patternProperties": {"^x-": {}}

types/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ type BuildConfig struct {
305305
Network string `yaml:",omitempty" json:"network,omitempty"`
306306
Target string `yaml:",omitempty" json:"target,omitempty"`
307307
Secrets []ServiceSecretConfig `yaml:",omitempty" json:"secrets,omitempty"`
308+
Tags StringList `mapstructure:"tags" yaml:"tags,omitempty" json:"tags,omitempty"`
308309

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

0 commit comments

Comments
 (0)