mirror of https://github.com/docker/docs.git
Merge pull request #13772 from icecrime/13770_image_labels_to_containers
Container don't inherit from image labels
This commit is contained in:
commit
af29aff53c
|
@ -269,7 +269,7 @@ func (s *DockerSuite) TestCreateLabelFromImage(c *check.C) {
|
||||||
}
|
}
|
||||||
|
|
||||||
name := "test_create_labels_from_image"
|
name := "test_create_labels_from_image"
|
||||||
expected := map[string]string{"k2": "x", "k3": "v3", "k1": "v1"}
|
expected := map[string]string{"k2": "x", "k3": "v3"}
|
||||||
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "create", "--name", name, "-l", "k2=x", "--label", "k3=v3", imageName)); err != nil {
|
if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "create", "--name", name, "-l", "k2=x", "--label", "k3=v3", imageName)); err != nil {
|
||||||
c.Fatal(out, err)
|
c.Fatal(out, err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,16 +41,6 @@ func Merge(userConf, imageConf *Config) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if userConf.Labels == nil {
|
|
||||||
userConf.Labels = map[string]string{}
|
|
||||||
}
|
|
||||||
if imageConf.Labels != nil {
|
|
||||||
for l := range userConf.Labels {
|
|
||||||
imageConf.Labels[l] = userConf.Labels[l]
|
|
||||||
}
|
|
||||||
userConf.Labels = imageConf.Labels
|
|
||||||
}
|
|
||||||
|
|
||||||
if userConf.Entrypoint.Len() == 0 {
|
if userConf.Entrypoint.Len() == 0 {
|
||||||
if userConf.Cmd.Len() == 0 {
|
if userConf.Cmd.Len() == 0 {
|
||||||
userConf.Cmd = imageConf.Cmd
|
userConf.Cmd = imageConf.Cmd
|
||||||
|
|
Loading…
Reference in New Issue