Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions loader/full-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ services:
RUN echo "hello" > /world.txt

foo:
annotations:
- com.example.foo=bar
build:
context: ./dir
dockerfile: Dockerfile
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 @@ -49,6 +49,9 @@ func services(workingDir, homeDir string) []types.ServiceConfig {
{
Name: "foo",

Annotations: map[string]string{
"com.example.foo": "bar",
},
Build: &types.BuildConfig{
Context: "./dir",
Dockerfile: "Dockerfile",
Expand Down Expand Up @@ -599,6 +602,8 @@ services:
FROM alpine
RUN echo "hello" > /world.txt
foo:
annotations:
com.example.foo: bar
build:
context: ./dir
dockerfile: Dockerfile
Expand Down Expand Up @@ -1145,6 +1150,9 @@ func fullExampleJSON(workingDir, homeDir string) string {
"entrypoint": null
},
"foo": {
"annotations": {
"com.example.foo": "bar"
},
"build": {
"context": "./dir",
"dockerfile": "Dockerfile",
Expand Down
1 change: 1 addition & 0 deletions schema/compose-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@

"properties": {
"deploy": {"$ref": "#/definitions/deployment"},
"annotations": {"$ref": "#/definitions/list_or_dict"},
"build": {
"oneOf": [
{"type": "string"},
Expand Down
1 change: 1 addition & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ type ServiceConfig struct {
Name string `yaml:"-" json:"-"`
Profiles []string `yaml:"profiles,omitempty" json:"profiles,omitempty"`

Annotations Mapping `yaml:"annotations,omitempty" json:"annotations,omitempty"`
Build *BuildConfig `yaml:"build,omitempty" json:"build,omitempty"`
BlkioConfig *BlkioConfig `yaml:"blkio_config,omitempty" json:"blkio_config,omitempty"`
CapAdd []string `yaml:"cap_add,omitempty" json:"cap_add,omitempty"`
Expand Down