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:
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:
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.