diff --git a/build/docker/util.go b/build/docker/util.go index c4b9d3e4d..f7ede3f92 100644 --- a/build/docker/util.go +++ b/build/docker/util.go @@ -14,6 +14,7 @@ func toContainerConfig(c *yaml.Container) *dockerclient.ContainerConfig { config := &dockerclient.ContainerConfig{ Image: c.Image, Env: toEnvironmentSlice(c.Environment), + Labels: c.Labels, Cmd: c.Command, Entrypoint: c.Entrypoint, WorkingDir: c.WorkingDir, diff --git a/yaml/container.go b/yaml/container.go index 012be8a0f..77e41c1f6 100644 --- a/yaml/container.go +++ b/yaml/container.go @@ -27,6 +27,7 @@ type Container struct { Privileged bool WorkingDir string Environment map[string]string + Labels map[string]string Entrypoint []string Command []string Commands []string @@ -61,6 +62,7 @@ type container struct { Pull bool `yaml:"pull"` Privileged bool `yaml:"privileged"` Environment types.MapEqualSlice `yaml:"environment"` + Labels types.MapEqualSlice `yaml:"labels"` Entrypoint types.StringOrSlice `yaml:"entrypoint"` Command types.StringOrSlice `yaml:"command"` Commands types.StringOrSlice `yaml:"commands"` @@ -129,6 +131,7 @@ func (c *containerList) UnmarshalYAML(unmarshal func(interface{}) error) error { Pull: cc.Pull, Privileged: cc.Privileged, Environment: cc.Environment.Map(), + Labels: cc.Labels.Map(), Entrypoint: cc.Entrypoint.Slice(), Command: cc.Command.Slice(), Commands: cc.Commands.Slice(),