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

Preserve first n layers when squashing

Open akhilles opened this issue 4 years ago • 1 comments

Similar to how -f can be used to squash the last n layers, it would be useful to have an argument (such as -p) to preserve the first n layers instead.

For now, this can be done manually with getting the layer count via docker history image:tag | wc -l and then subtracting the number of layers you want to preserve.

akhilles avatar Apr 11 '20 02:04 akhilles

Other option would be to allow for negative numbers.

goldmann avatar Jul 28 '21 07:07 goldmann