[From nobody Mon May 25 22:57:05 2026
Received: (at submit) by bugs.debian.org; 10 Mar 2026 10:21:26 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-15.2 required=4.0 tests=BAYES_00,
 BODY_INCLUDES_PACKAGE,DKIM_SIGNED,DKIM_VALID,FOURLA,FROMDEVELOPER,
 HAS_PACKAGE,MONEY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,STOCKLIKE
 autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 17; hammy, 150; neutral, 181; spammy,
 0. spammytokens: hammytokens:0.000-+--HTo:N*Debian,
 0.000-+--H*Ad:N*Bug, 0.000-+--H*Ad:N*Tracking, 0.000-+--sk:golang,
 0.000-+--sk:golang-
Return-path: &lt;jmtd@debian.org&gt;
Received: from redmars.org ([178.79.130.180]:41436 helo=chew.redmars.org)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;jmtd@debian.org&gt;) id 1vzuDN-003SaP-2Y
 for submit@bugs.debian.org; Tue, 10 Mar 2026 10:21:26 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dow.land;
 s=20210720; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:
 Subject:To:From:Date:Sender:Reply-To:Cc:Content-ID:Content-Description:
 Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
 In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
 List-Post:List-Owner:List-Archive;
 bh=YrMz3stvcKS7O/BWr3f7idcxQNGwOICHLOIFYsMAi20=; b=vjBzjsncbhflRaGIHeKnbtyzlK
 9gXhGafCNeC4bIo5PCdGqBNxdcYAzzdbZZcDfmCewikuPYMpNfKmPDilWDjdCqdevcSVq3HmLiMfZ
 ueQXq5RS8dRmNUdu9Nl8joKkMzUvoL5UYFmIZemNOokx3QcTPLF599+01X+oHzTArBXc=;
Received: from 234.182.199.146.dyn.plus.net ([146.199.182.234] helo=coil)
 by chew.redmars.org with esmtpsa (TLS1.3) tls
 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2)
 (envelope-from &lt;jmtd@debian.org&gt;)
 id 1vzuDL-0000Sk-EF; Tue, 10 Mar 2026 10:21:23 +0000
Date: Tue, 10 Mar 2026 10:21:21 +0000
From: Jonathan Dowland &lt;jmtd@debian.org&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: podman: build --squash is not squashing the built images
Message-ID: &lt;2sbqebhpsdgwwznslm7qzxt4ejxs4go4pv6btta5n72yrz5lte@u7qnrksqj74r&gt;
X-Reportbug-Version: 13.2.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Delivered-To: submit@bugs.debian.org

Package: podman
Version: 5.7.0+ds2-3
Severity: normal

podman has two squashing build parameters:

   --squash
       Squash all of the image's new layers into a single new layer; any preexisting layers are not squashed.

   --squash-all
       Squash all of the new image's layers (including those inherited from a base image) into a single new layer.

The '--squash' parameter doesn't work. Note from the below session 
excerpt, the image checksum for '--squash' and '&lt;nothing&gt;' are 
identical, and contain 23 layers.

Expected behaviour would be base image + 1. In this case base image has 
22. (I can provide this container source if requested, but it's not 
relevant)

$ podman build -t nosquash ./
$ podman build --squash -t squash ./
$ podman build --squash-all -t squashall ./
$ skopeo inspect containers-storage:localhost/nosquash | jq '.Layers | length'
23
$ skopeo inspect containers-storage:localhost/squash | jq '.Layers | length'
23
$ skopeo inspect containers-storage:localhost/squashall | jq '.Layers | length'
1

$ podman images | head
REPOSITORY              TAG          IMAGE ID      CREATED         SIZE
localhost/squashall     latest       539639a5c074  5 minutes ago   1.07 GB
localhost/squash        latest       8b6e819c2b11  6 minutes ago   1.08 GB
localhost/nosquash      latest       8b6e819c2b11  6 minutes ago   1.08 GB





-- System Information:
Debian Release: 13.3
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'stable-security'), (500, 'oldoldstable'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.16.9+deb14-amd64 (SMP w/24 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages podman depends on:
ii  conmon                           2.1.12-4
ii  golang-github-containers-common  0.66.0+ds2-3
ii  init-system-helpers              1.69~deb13u1
ii  libc6                            2.41-12+deb13u1
ii  libgpgme45                       2.0.1-2
ii  libseccomp2                      2.6.0-2
ii  libsqlite3-0                     3.46.1-7
ii  libsubid5                        1:4.17.4-2
ii  netavark                         1.14.0-2
ii  runc                             1.1.15+ds1-2+b4

Versions of packages podman recommends:
ii  buildah             1.42.1+ds1-2
ii  ca-certificates     20250419
ii  containers-storage  1.57.2+ds1-1+b2
ii  criu                4.1.1-1
ii  dbus-user-session   1.16.2-2
ii  libcriu2            4.1.1-1
ii  passt               0.0~git20250503.587980c-2
ii  slirp4netns         1.2.1-1.1
ii  tini                0.19.0-3+b5
ii  uidmap              1:4.17.4-2

Versions of packages podman suggests:
ii  containernetworking-plugins  1.1.1+ds1-3+b17
ii  docker-compose               2.26.1-4
ii  iptables                     1.8.11-2

-- no debconf information

-- 
👱🏻	Jonathan Dowland
✎	    jon@dow.land
🔗	        jmtd.net
]