Any way to squash last N images in buildah (or podman) without additional tools?

1.4k Views Asked by At

Actually, the question title says it all.

I found two tools that can possibly solve the problem, but I'd much rather go with something built into podman/buildah that already have the know-how of dealing with layers in an image:

1

There are 1 best solutions below

0
On

I see two options in podman:

$ podman build --help | grep squash 
      --squash        squash newly built layers into a single new layer
      --squash-all    Squash all layers into a single layer

$ podman --version
podman version 3.4.0

I think the latter also squashes the base container layers, which is not the Docker behaviour for this command.

You can check at this GitHub PR for more info.