{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/14515","labels_url":"https://api.github.com/repos/docker/docker/issues/14515/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/14515/comments","events_url":"https://api.github.com/repos/docker/docker/issues/14515/events","html_url":"https://github.com/docker/docker/issues/14515","id":94191376,"number":14515,"title":"Anonymous volume not getting cleaned up on \"docker rm\"","user":{"login":"kunalkushwaha","id":2758433,"avatar_url":"https://avatars.githubusercontent.com/u/2758433?v=3","gravatar_id":"","url":"https://api.github.com/users/kunalkushwaha","html_url":"https://github.com/kunalkushwaha","followers_url":"https://api.github.com/users/kunalkushwaha/followers","following_url":"https://api.github.com/users/kunalkushwaha/following{/other_user}","gists_url":"https://api.github.com/users/kunalkushwaha/gists{/gist_id}","starred_url":"https://api.github.com/users/kunalkushwaha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kunalkushwaha/subscriptions","organizations_url":"https://api.github.com/users/kunalkushwaha/orgs","repos_url":"https://api.github.com/users/kunalkushwaha/repos","events_url":"https://api.github.com/users/kunalkushwaha/events{/privacy}","received_events_url":"https://api.github.com/users/kunalkushwaha/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-10T01:36:25Z","updated_at":"2015-07-10T01:49:40Z","closed_at":"2015-07-10T01:49:40Z","body":"Hi,\r\n\r\nIf an image is build with anonymous volume, on every ``docker run`` command with this image, one volume gets created in ``/var/lib/docker/volumes`` folder. \r\n\r\nISSUE:\r\nWhen the container exists or even on ``docker rm``, these volumes are not removed.\r\nThis results in lot of unused data kept in ``/var/lib/docker`` and makes disk full situation.\r\n\r\nSteps to reproduce:\r\nI build one image using Dockerfile with VOLUME tag as below.\r\n\r\n```\r\nroot at kunal in ~/work/custom_images/_abc\r\n○ cat Dockerfile \r\nFROM busybox  \r\nRUN mkdir /data\r\nRUN touch /data/somefile1\r\nRUN touch /data/somefile4\r\nVOLUME /data \r\nCMD sh\r\n```\r\n\r\nAfter building, image using dockerfile, create docker container from image.\r\n\r\n```\r\nroot at kunal in ~/work/custom_images/_abc          \r\n○ docker run -it 854653c4ffa1 \r\n/ # ls                                        \r\nbin      etc      lib64    mnt      root     sys      var                   \r\ndata     home     linuxrc  opt      run      tmp                         \r\ndev      lib      media    proc     sbin     usr                            \r\n/ # ls data                                                                            \r\nsomefile1  somefile4                                                           \r\n/ # exit      \r\n```\r\nDeletes the container\r\n```\r\nroot at proxy in ~/work/custom_images/_abc          \r\n○ docker rm 2fdadaa46943                                     \r\n2fdadaa46943    \r\n```\r\nCheck if volume gets deleted \r\n```\r\nroot at kunal in ~\r\n○ ls -l /var/lib/docker/volumes\r\ntotal 0\r\ndrwxr-xr-x. 3 root root 18  7月 10 00:45 8af637e9f55fe208b22dc1d7cd76669d5c0735152a0ba0cde42d9e32dc5761b5\r\n\r\nroot at kunal in ~\r\n○ tree /var/lib/docker/volumes/8af637e9f55fe208b22dc1d7cd76669d5c0735152a0ba0cde42d9e32dc5761b5/\r\n/var/lib/docker/volumes/8af637e9f55fe208b22dc1d7cd76669d5c0735152a0ba0cde42d9e32dc5761b5/\r\n`-- _data\r\n    |-- somefile1\r\n    `-- somefile4\r\n\r\n1 directory, 2 files\r\n\r\n```\r\n\r\nI am using docker 1.7.0 release on CentOS 7\r\n\r\n```\r\nroot at kunal in ~/work/custom_images/_abc\r\n○ docker version\r\nClient version: 1.7.0\r\nClient API version: 1.19\r\nGo version (client): go1.4.2\r\nGit commit (client): 0baf609\r\nOS/Arch (client): linux/amd64\r\nServer version: 1.7.0\r\nServer API version: 1.19\r\nGo version (server): go1.4.2\r\nGit commit (server): 0baf609\r\nOS/Arch (server): linux/amd64\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/120198987","html_url":"https://github.com/docker/docker/issues/14515#issuecomment-120198987","issue_url":"https://api.github.com/repos/docker/docker/issues/14515","id":120198987,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T01:49:40Z","updated_at":"2015-07-10T01:49:40Z","body":"You can use `docker rm -v` to remove the volume automatically.\r\nThere are also a number of tools out there to help manage the dangling volumes while we work on a volume management UI."}}