goldmann / docker-squash

Docker image squashing tool
MIT License
848 stars 109 forks source link

Preserve first n layers when squashing #193

Open akhilles opened 4 years ago

akhilles commented 4 years ago

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.

goldmann commented 3 years ago

Other option would be to allow for negative numbers.