title: How to automatically remove old Docker images?
body: <p>After using Docker for some times now, I actually run into disk space issues because many images were stored (one for each version) :</p>
  
  <pre><code>REPOSITORY  TAG          IMAGE ID            CREATED             VIRTUAL SIZE
  registry    latest       376ca9433bfe        4 weeks ago         429.1 MB
  registry    0.6.5        376ca9433bfe        4 weeks ago         429.1 MB
  registry    0.6.3        1f7bbd131cd8        5 weeks ago         486.2 MB
  registry    0.6.2        0b520d776e7d        5 weeks ago         466.5 MB
  registry    0.6.1        9f98cb899f46        5 weeks ago         456.4 MB
  registry    0.6.0        873f518b98ef        5 weeks ago         466.4 MB
  registry    0.6.4        b04ace768d59        5 weeks ago         486.2 MB
  </code></pre>
  
  <p>I know that I can use <code>Docker rmi &lt;IMAGE_ID&gt;</code> to remove old versions.  </p>
  
  <p>Is there a way to limit the number of image versions stored in Docker, or to automatically remove them ?</p>