docker-squash icon indicating copy to clipboard operation
docker-squash copied to clipboard

Better squashing

Open Nixxx11 opened this issue 7 months ago • 2 comments

  1. Updated github runner to ubuntu-22.04 (ubuntu-20.04 is no longer supported). Unfortunately, it does not have python 3.6
  2. Added a couple of new tests (https://github.com/goldmann/docker-squash/issues/253 and a few others)
  3. Reworked squashing process:
    • Replaced lists with sets in some places
    • Removed special handling of symlinks. Broken symlinks are fine, we don't need to delete them
    • Added hardlink to regular file conversion, simplifying things a lot. It shouldn't affect much, considering docker already does that conversion if you try to create link to a file from another layer
    • Squashing now only takes a single pass, no need to return to the previous layers to add back some skipped files (https://github.com/goldmann/docker-squash/issues/64 is now doable, I guess?)

There are a lot of changes, so we have to check that everything still works as expected. I don't think that existing tests cover all the corner cases and possible bugs. And it would be nice to run some benchmarking to see whether the new solution is faster or not

Nixxx11 avatar May 15 '25 14:05 Nixxx11

@goldmann Any chance of reviewing this?

satmandu avatar May 29 '25 20:05 satmandu

FYI for any ubuntu/debian users who want to live dangerously, I installed from this PR using:

pip install --break-system-packages git+https://github.com/Nixxx11/docker-squash.git#egg=docker-squash

satmandu avatar Jul 05 '25 14:07 satmandu