title: Is there a way to clean docker build cache?
body: <p>I am running a lot of builds using Docker in MacOS. Eventually, a lot of build cache is accumulating, e.g. this is what I see in <code>docker system df</code>:</p>
  <pre><code>YPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
  Images          22        0         9.67GB    9.67GB (100%)
  Containers      0         0         0B        0B
  Local Volumes   0         0         0B        0B
  Build Cache     1006      0         258GB     258GB
  </code></pre>
  <p>Is there a way to clean items from the build cache? I can see detailed list of them, e.g.:</p>
  <pre><code>CACHE ID       CACHE TYPE     SIZE      CREATED             LAST USED           USAGE     SHARED
  045834a7a6e9   regular        11.1MB    3 weeks ago                             0         false
  114ca5b7280f   regular        114MB     3 weeks ago                             0         false
  27d6fcbb531d   regular        1.65kB    3 weeks ago                             0         false
  3042a2a59d4f   regular        553kB     3 weeks ago                             0         false
  3d70c1a312eb   regular        468MB     3 weeks ago                             0         false
  658aaefc4cdd   regular        209MB     3 weeks ago                             0         false
  7d5b48149871   regular        59.9MB    3 weeks ago                             0         false
  86569a54d5d4   regular        16.5MB    3 weeks ago                             0         false
  </code></pre>
  <p>etc. with <code>docker system df -v</code> but the only way I see to remove any is completely wiping all Docker data, including images, etc. which I don't want to do. Is there any other way to make Docker to reclaim the space? I can see those objects but I can find no way of deleting them...</p>
  <p>P.S.1 This question is <strong>not</strong> about how to delete images and containers. I know how to delete them, unfortunately deleting either does nothing to the &quot;Build Cache&quot; contents which continues to occupy space.</p>
  <p>P.S.2 This is especially important on MacOS because there Docker operates within one specific allocated volume, which this way gets exhausted very quickly and I start getting &quot;out of disk space&quot; errors when building. Since the builds are done repeatedly, keeping data from old builds is not useful for me, so finding a way to delete old build caches would be great.</p>