Hello community, here is the log from the commit of package docker for openSUSE:Factory checked in at 2015-01-22 21:49:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/docker (Old) and /work/SRC/openSUSE:Factory/.docker.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "docker" Changes: -------- --- /work/SRC/openSUSE:Factory/docker/docker.changes 2014-12-21 12:04:42.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.docker.new/docker.changes 2015-01-22 21:50:20.000000000 +0100 @@ -1,0 +2,16 @@ +Thu Jan 15 10:00:07 UTC 2015 - [email protected] + +- Updated to 1.4.1 (2014-12-15): + * Runtime: + - Fix issue with volumes-from and bind mounts not being honored after + create (fixes bnc#913213) + +------------------------------------------------------------------- +Thu Jan 15 09:41:20 UTC 2015 - [email protected] + +- Added e2fsprogs as runtime dependency, this is required when the + devicemapper driver is used. (bnc#913211). +- Fixed owner & group for docker.socket (thanks to Andrei Dziahel and + https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752555#5) + +------------------------------------------------------------------- Old: ---- docker-1.4.0.tar.bz2 New: ---- docker-1.4.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ docker.spec ++++++ --- /var/tmp/diff_new_pack.WuuYwK/_old 2015-01-22 21:50:21.000000000 +0100 +++ /var/tmp/diff_new_pack.WuuYwK/_new 2015-01-22 21:50:21.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package docker # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,9 +16,9 @@ # -%define git_version 4595d4f +%define git_version 5bc2ff8 Name: docker -Version: 1.4.0 +Version: 1.4.1 Release: 0 Summary: The Linux container runtime License: Apache-2.0 @@ -47,6 +47,8 @@ Requires: apparmor-parser Requires: bridge-utils Requires: ca-certificates-mozilla +# Provides mkfs.ext4 - used by Docker when devicemapper storage driver is used +Requires: e2fsprogs Requires: git-core >= 1.7 Requires: iproute2 >= 3.5 Requires: iptables >= 1.4 ++++++ docker-1.4.0.tar.bz2 -> docker-1.4.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docker/CHANGELOG.md new/docker/CHANGELOG.md --- old/docker/CHANGELOG.md 2014-12-12 17:09:40.000000000 +0100 +++ new/docker/CHANGELOG.md 2015-01-15 10:59:21.000000000 +0100 @@ -1,5 +1,10 @@ # Changelog +## 1.4.1 (2014-12-15) + +#### Runtime +- Fix issue with volumes-from and bind mounts not being honored after create + ## 1.4.0 (2014-12-11) #### Notable Features since 1.3.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docker/VERSION new/docker/VERSION --- old/docker/VERSION 2014-12-12 17:09:42.000000000 +0100 +++ new/docker/VERSION 2015-01-15 10:59:22.000000000 +0100 @@ -1 +1 @@ -1.4.0 +1.4.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docker/daemon/volumes.go new/docker/daemon/volumes.go --- old/docker/daemon/volumes.go 2014-12-12 17:09:40.000000000 +0100 +++ new/docker/daemon/volumes.go 2015-01-15 10:59:21.000000000 +0100 @@ -24,6 +24,7 @@ volume *volumes.Volume Writable bool copyData bool + from *Container } func (mnt *Mount) Export(resource string) (io.ReadCloser, error) { @@ -42,9 +43,6 @@ if container.Volumes == nil || len(container.Volumes) == 0 { container.Volumes = make(map[string]string) container.VolumesRW = make(map[string]bool) - if err := container.applyVolumesFrom(); err != nil { - return err - } } return container.createVolumes() @@ -73,13 +71,27 @@ } } - return nil + // On every start, this will apply any new `VolumesFrom` entries passed in via HostConfig, which may override volumes set in `create` + return container.applyVolumesFrom() } func (m *Mount) initialize() error { // No need to initialize anything since it's already been initialized - if _, exists := m.container.Volumes[m.MountToPath]; exists { - return nil + if hostPath, exists := m.container.Volumes[m.MountToPath]; exists { + // If this is a bind-mount/volumes-from, maybe it was passed in at start instead of create + // We need to make sure bind-mounts/volumes-from passed on start can override existing ones. + if !m.volume.IsBindMount && m.from == nil { + return nil + } + if m.volume.Path == hostPath { + return nil + } + + // Make sure we remove these old volumes we don't actually want now. + // Ignore any errors here since this is just cleanup, maybe someone volumes-from'd this volume + v := m.container.daemon.volumes.Get(hostPath) + v.RemoveContainer(m.container.ID) + m.container.daemon.volumes.Delete(v.Path) } // This is the full path to container fs + mntToPath @@ -217,6 +229,7 @@ for _, mounts := range mountGroups { for _, mnt := range mounts { + mnt.from = mnt.container mnt.container = container if err := mnt.initialize(); err != nil { return err diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docker/docs/sources/reference/api/docker_remote_api.md new/docker/docs/sources/reference/api/docker_remote_api.md --- old/docker/docs/sources/reference/api/docker_remote_api.md 2014-12-12 17:09:41.000000000 +0100 +++ new/docker/docs/sources/reference/api/docker_remote_api.md 2015-01-15 10:59:21.000000000 +0100 @@ -61,12 +61,6 @@ **New!** Volumes are now initialized when the container is created. -`POST /containers/(id)/start` - -**New!** -Passing the container's `HostConfig` on start is now deprecated. You should -set this when creating the container. - `POST /containers/(id)/copy` **New!** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docker/integration-cli/docker_api_containers_test.go new/docker/integration-cli/docker_api_containers_test.go --- old/docker/integration-cli/docker_api_containers_test.go 2014-12-12 17:09:41.000000000 +0100 +++ new/docker/integration-cli/docker_api_containers_test.go 2015-01-15 10:59:22.000000000 +0100 @@ -4,7 +4,10 @@ "bytes" "encoding/json" "io" + "io/ioutil" + "os" "os/exec" + "strings" "testing" "github.com/docker/docker/vendor/src/code.google.com/p/go/src/pkg/archive/tar" @@ -120,3 +123,131 @@ logDone("container REST API - check GET containers/changes") } + +func TestContainerApiStartVolumeBinds(t *testing.T) { + defer deleteAllContainers() + name := "testing" + config := map[string]interface{}{ + "Image": "busybox", + "Volumes": map[string]struct{}{"/tmp": {}}, + } + + if _, err := sockRequest("POST", "/containers/create?name="+name, config); err != nil && !strings.Contains(err.Error(), "201 Created") { + t.Fatal(err) + } + + bindPath, err := ioutil.TempDir(os.TempDir(), "test") + if err != nil { + t.Fatal(err) + } + + config = map[string]interface{}{ + "Binds": []string{bindPath + ":/tmp"}, + } + if _, err := sockRequest("POST", "/containers/"+name+"/start", config); err != nil && !strings.Contains(err.Error(), "204 No Content") { + t.Fatal(err) + } + + pth, err := inspectFieldMap(name, "Volumes", "/tmp") + if err != nil { + t.Fatal(err) + } + + if pth != bindPath { + t.Fatalf("expected volume host path to be %s, got %s", bindPath, pth) + } + + logDone("container REST API - check volume binds on start") +} + +func TestContainerApiStartVolumesFrom(t *testing.T) { + defer deleteAllContainers() + volName := "voltst" + volPath := "/tmp" + + if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "--name", volName, "-v", volPath, "busybox")); err != nil { + t.Fatal(out, err) + } + + name := "testing" + config := map[string]interface{}{ + "Image": "busybox", + "Volumes": map[string]struct{}{volPath: {}}, + } + + if _, err := sockRequest("POST", "/containers/create?name="+name, config); err != nil && !strings.Contains(err.Error(), "201 Created") { + t.Fatal(err) + } + + config = map[string]interface{}{ + "VolumesFrom": []string{volName}, + } + if _, err := sockRequest("POST", "/containers/"+name+"/start", config); err != nil && !strings.Contains(err.Error(), "204 No Content") { + t.Fatal(err) + } + + pth, err := inspectFieldMap(name, "Volumes", volPath) + if err != nil { + t.Fatal(err) + } + pth2, err := inspectFieldMap(volName, "Volumes", volPath) + if err != nil { + t.Fatal(err) + } + + if pth != pth2 { + t.Fatalf("expected volume host path to be %s, got %s", pth, pth2) + } + + logDone("container REST API - check VolumesFrom on start") +} + +// Ensure that volumes-from has priority over binds/anything else +// This is pretty much the same as TestRunApplyVolumesFromBeforeVolumes, except with passing the VolumesFrom and the bind on start +func TestVolumesFromHasPriority(t *testing.T) { + defer deleteAllContainers() + volName := "voltst" + volPath := "/tmp" + + if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "-d", "--name", volName, "-v", volPath, "busybox")); err != nil { + t.Fatal(out, err) + } + + name := "testing" + config := map[string]interface{}{ + "Image": "busybox", + "Volumes": map[string]struct{}{volPath: {}}, + } + + if _, err := sockRequest("POST", "/containers/create?name="+name, config); err != nil && !strings.Contains(err.Error(), "201 Created") { + t.Fatal(err) + } + + bindPath, err := ioutil.TempDir(os.TempDir(), "test") + if err != nil { + t.Fatal(err) + } + + config = map[string]interface{}{ + "VolumesFrom": []string{volName}, + "Binds": []string{bindPath + ":/tmp"}, + } + if _, err := sockRequest("POST", "/containers/"+name+"/start", config); err != nil && !strings.Contains(err.Error(), "204 No Content") { + t.Fatal(err) + } + + pth, err := inspectFieldMap(name, "Volumes", volPath) + if err != nil { + t.Fatal(err) + } + pth2, err := inspectFieldMap(volName, "Volumes", volPath) + if err != nil { + t.Fatal(err) + } + + if pth != pth2 { + t.Fatalf("expected volume host path to be %s, got %s", pth, pth2) + } + + logDone("container REST API - check VolumesFrom has priority") +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docker/integration-cli/docker_cli_build_test.go new/docker/integration-cli/docker_cli_build_test.go --- old/docker/integration-cli/docker_cli_build_test.go 2014-12-12 17:09:41.000000000 +0100 +++ new/docker/integration-cli/docker_cli_build_test.go 2015-01-15 10:59:22.000000000 +0100 @@ -3914,3 +3914,37 @@ logDone("build - xz host is being used") } + +func TestBuildVolumesRetainContents(t *testing.T) { + var ( + name = "testbuildvolumescontent" + expected = "some text" + ) + defer deleteImages(name) + ctx, err := fakeContext(` +FROM busybox +COPY content /foo/file +VOLUME /foo +CMD cat /foo/file`, + map[string]string{ + "content": expected, + }) + if err != nil { + t.Fatal(err) + } + defer ctx.Close() + + if _, err := buildImageFromContext(name, ctx, false); err != nil { + t.Fatal(err) + } + + out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "run", "--rm", name)) + if err != nil { + t.Fatal(err) + } + if out != expected { + t.Fatalf("expected file contents for /foo/file to be %q but received %q", expected, out) + } + + logDone("build - volumes retain contents in build") +} Files old/docker/project/.PACKAGERS.md.swp and new/docker/project/.PACKAGERS.md.swp differ ++++++ docker.socket ++++++ --- /var/tmp/diff_new_pack.WuuYwK/_old 2015-01-22 21:50:23.000000000 +0100 +++ /var/tmp/diff_new_pack.WuuYwK/_new 2015-01-22 21:50:23.000000000 +0100 @@ -4,8 +4,12 @@ [Socket] ListenStream=/var/run/docker.sock SocketMode=0660 -SocketUser=root -SocketGroup=docker +# TODO: Get rid of workaround below after adopting systemd 214+ by oS Factory +# Socket(User|Group) are available as of systemd 214+ +#SocketUser=root +#SocketGroup=docker +# Fix owner manually +ExecStartPost=/usr/bin/chown root:docker /var/run/docker.sock [Install] WantedBy=sockets.target -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
