{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/10759","labels_url":"https://api.github.com/repos/docker/docker/issues/10759/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/10759/comments","events_url":"https://api.github.com/repos/docker/docker/issues/10759/events","html_url":"https://github.com/docker/docker/issues/10759","id":57574810,"number":10759,"title":"Prevent docker from eating disk space","user":{"login":"MitchK","id":2472064,"avatar_url":"https://avatars.githubusercontent.com/u/2472064?v=3","gravatar_id":"","url":"https://api.github.com/users/MitchK","html_url":"https://github.com/MitchK","followers_url":"https://api.github.com/users/MitchK/followers","following_url":"https://api.github.com/users/MitchK/following{/other_user}","gists_url":"https://api.github.com/users/MitchK/gists{/gist_id}","starred_url":"https://api.github.com/users/MitchK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MitchK/subscriptions","organizations_url":"https://api.github.com/users/MitchK/orgs","repos_url":"https://api.github.com/users/MitchK/repos","events_url":"https://api.github.com/users/MitchK/events{/privacy}","received_events_url":"https://api.github.com/users/MitchK/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T09:05:09Z","updated_at":"2015-02-13T14:39:59Z","closed_at":"2015-02-13T14:39:58Z","body":"In our operations landscape we only want our Docker registry to grow in disk usage.\r\n\r\nEspecially in our Continuous Delivery cycles we often have the problem that our CI instance/docker nodes run out of disk space. \r\n\r\nSo we need to do ``` docker rmi `docker images -a -q` ``` / ```docker rm -f `docker ps -a -q` ```manually.\r\n\r\nAre there any best practices, e.g. not keeping old containers/images? "},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/74262815","html_url":"https://github.com/docker/docker/issues/10759#issuecomment-74262815","issue_url":"https://api.github.com/repos/docker/docker/issues/10759","id":74262815,"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-02-13T14:39:58Z","updated_at":"2015-02-13T14:39:58Z","body":"For support on Docker, please see #docker on IRC, docker-user mailing list, or forums.docker.com\r\n\r\nTo answer your question:\r\n`docker rmi $(docker images -q --filter dangling=true)`\r\nA dangling image is essentially an unreachable image, in the context that the only images you probably want to use are tagged images and not specific image ID's... so a dangling image is one that is not within the tree of a tagged image.\r\n\r\nNow, some containers may be using one of these dangling images (and you probably want to update those containers to use the tagged image)  due to pulling newer versions of the image, and as such Docker can't remove that image until no container is using it anymore.\r\n\r\nYou probably want to make sure you are cleaning up volumes as well.  Docker does not remove volumes unless you tell it to upon removing a container: `docker rm -v <container>`.\r\nYou can use https://github.com/cpuguy83/docker-volumes to help with pruning these.\r\n\r\n\r\nClosing since this isn't really an issue."}}