Do you know of any such tools? For clarity, I’m not looking to “flatten” an image into a single or fewer layers, mostly to make the intermediate tar files compressed.
I don’t fully understand what you mean in terms of the intermediate layers and I know youve said youre not looking to flatten but here are some of the things I found out.
I couldnt get docker-slim to work and since nix utilizes the store which is readonly Im not sure it could do much
you can try play with maxLayers, it needs to be more than 1 but you can end up squishing things quite flat, the size will end up the same though in my experience
Also FYI you can use dive to inspect an image’s layers which is very nice
Maybe you could read through this mergeImages shell script and find something useful?
I’m not looking to squash or remove or slim down an image, I’m looking to store the individual layers in application/vnd.oci.image.layer.v1.tar+gzip.
A container image is a single tarball made up of a manifest, a configuration, and then 1 or more layers. I’m not concerned about the outer layer being a compressed or uncompressed tar, I’m interested in the intermediate layers being compressed tarballs.