title: docker folder takes too much space
body: <p>I have an aws ec2 instance running docker. The problem is <code>/var/lib/docker</code> directory size keeps increasing.</p>
  <p>Under it, these two subdirectories take most space:</p>
  <pre><code>8.4G    ./overlay2
  43G     ./volumes
  </code></pre>
  <p>The running application shouldn't take that much space. So I digged into <code>./volumes</code> the disk usage there is like:</p>
  <pre><code>0   ./01f77dcc583d434c55435ca2d255a4db5caabd4312bc23439562b8c3cc0335e5
  301M    ./36cb5b2025508bcbbdd12d222c2a61961f890e01d66c63fa8c54fcf8af6ee845
  0   ./cf5a236c8355b5776a340a90cd1d0c1498a4c23f886d093567e08b2c81d54c29
  0   ./5a01732daed19e4c46c50bba8329d3760b9421ac182e16f88f9f840d9d21073a
  301M    ./60a8318f278b2943121e2540e67e74928fa31b089ea4ba1a11066f00a458a883
  0   ./b44be033795633706217140dd50d73f43cf01be6703e4eea194e0548dd13f2ea
  301M    ./c577cd0e8d004d85a5288fe0b597e7c463051a76e59bea63844b68161775b5a9
  ...
  </code></pre>
  <p>Lines like that repeat a lot, seems like dangling containers. I then tried <code>docker system prune -f -a</code>, only claimed me less than 1G.</p>
  <p>What's going wrong there, and what's a good solution? Thanks!</p>
  <p><strong>UPDATE</strong></p>
  <p><code>docker volume prune</code> claimed 44G space to me. So is it when docker removes a stopped container, it doesn't remove the volume as well? How can I prevent it from happening again?</p>