FYI After consulting Depot devs, the out-of-space bugs have largely disappeared after we updated dockerfile COPY --link
to COPY
.
This looks like a bug in buildkit as it is not always accounting for the size of --link layers correctly. Sometimes buildkit thinks those layers are zero bytes in size despite being multiple gigabytes. When GC runs, it thinks the disk has far more space than it really does!