{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/14622","labels_url":"https://api.github.com/repos/docker/docker/issues/14622/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/14622/comments","events_url":"https://api.github.com/repos/docker/docker/issues/14622/events","html_url":"https://github.com/docker/docker/issues/14622","id":94926959,"number":14622,"title":"Volumes left orphaned when not all refering containers use `-v`","user":{"login":"jest","id":161816,"avatar_url":"https://avatars.githubusercontent.com/u/161816?v=3","gravatar_id":"","url":"https://api.github.com/users/jest","html_url":"https://github.com/jest","followers_url":"https://api.github.com/users/jest/followers","following_url":"https://api.github.com/users/jest/following{/other_user}","gists_url":"https://api.github.com/users/jest/gists{/gist_id}","starred_url":"https://api.github.com/users/jest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jest/subscriptions","organizations_url":"https://api.github.com/users/jest/orgs","repos_url":"https://api.github.com/users/jest/repos","events_url":"https://api.github.com/users/jest/events{/privacy}","received_events_url":"https://api.github.com/users/jest/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/kind/bug","name":"kind/bug","color":"FF8C94"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-14T11:38:47Z","updated_at":"2015-07-14T13:04:58Z","closed_at":null,"body":"[The docs][1] say that the volume will be removed when the last referring container uses `rm -v`. However, this doesn't happen when previously some containers were removed without `-v` switch:\r\n\r\n```\r\n$ docker create --name d1 -v /data busybox\r\n$ docker create --name c1 --volumes-from d1 busybox\r\n$ VOL=$(docker inspect -f '{{ index .Volumes \"/data\" }}' d1)\r\n$ ls -d $VOL\r\n/var/lib/docker/volumes/f2cf6f32f91fbf1d9778665c1b20ac09146f1b066c1f4d73746954b1ae66cb03/_data\r\n$ docker rm c1\r\n$ docker rm -v d1\r\n$ sudo ls -d $VOL\r\n/var/lib/docker/volumes/f2cf6f32f91fbf1d9778665c1b20ac09146f1b066c1f4d73746954b1ae66cb03/_data\r\n```\r\n\r\n`docker info`:\r\n```\r\nContainers: 3\r\nImages: 61\r\nStorage Driver: aufs\r\n Root Dir: /var/lib/docker/aufs\r\n Backing Filesystem: extfs\r\n Dirs: 67\r\n Dirperm1 Supported: true\r\nExecution Driver: native-0.2\r\nLogging Driver: json-file\r\nKernel Version: 3.19.0-22-generic\r\nOperating System: Ubuntu 14.04.2 LTS\r\nCPUs: 8\r\nTotal Memory: 11.46 GiB\r\nName: pw-tp\r\nID: ZTDW:FI5G:NERJ:QYQB:6GWU:PTCK:AC7E:YAHH:G4L7:I45P:SLDC:ZLCU\r\nWARNING: No swap limit support\r\n```\r\n\r\n\r\n[1]: https://docs.docker.com/userguide/dockervolumes/#creating-and-mounting-a-data-volume-container"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/121233108","html_url":"https://github.com/docker/docker/issues/14622#issuecomment-121233108","issue_url":"https://api.github.com/repos/docker/docker/issues/14622","id":121233108,"user":{"login":"jest","id":161816,"avatar_url":"https://avatars.githubusercontent.com/u/161816?v=3","gravatar_id":"","url":"https://api.github.com/users/jest","html_url":"https://github.com/jest","followers_url":"https://api.github.com/users/jest/followers","following_url":"https://api.github.com/users/jest/following{/other_user}","gists_url":"https://api.github.com/users/jest/gists{/gist_id}","starred_url":"https://api.github.com/users/jest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jest/subscriptions","organizations_url":"https://api.github.com/users/jest/orgs","repos_url":"https://api.github.com/users/jest/repos","events_url":"https://api.github.com/users/jest/events{/privacy}","received_events_url":"https://api.github.com/users/jest/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T13:04:58Z","updated_at":"2015-07-14T13:04:58Z","body":"OK, I see. So restarting the daemon before the last `rm -v` is a workaround."}}