-
Notifications
You must be signed in to change notification settings - Fork 879
Open
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
Description
When using podman build --cache-to, the compression_format setting from containers.conf is ignored for both the cache layers AND the final image. Without --cache-to, the compression format is respected correctly.
Steps to Reproduce
- Create a minimal
containers.confwith zstd:chunked:
[engine]
compression_format="zstd:chunked"- Create a minimal Dockerfile:
FROM alpine:latest
RUN echo "layer1" > /layer1.txt
RUN echo "layer2" > /layer2.txt- Build and push WITHOUT
--cache-to:
podman build --no-cache --layers -t quay.io/jdanek/cache-compression-test:v8 .
podman push quay.io/jdanek/cache-compression-test:v8
crane manifest quay.io/jdanek/cache-compression-test:v8 | jq -r '.layers[].mediaType'Result: application/vnd.oci.image.layer.v1.tar+zstd ✓ (correct)
- Build and push WITH
--cache-to:
podman system reset -f
podman build --no-cache --layers --cache-to quay.io/jdanek/cache-compression-test-cache-v6 -t quay.io/jdanek/cache-compression-test:v7 .
podman push quay.io/jdanek/cache-compression-test:v7
crane manifest quay.io/jdanek/cache-compression-test:v7 | jq -r '.layers[].mediaType'Result: application/vnd.oci.image.layer.v1.tar+gzip ✗ (should be zstd)
The cache also uses gzip:
crane manifest quay.io/jdanek/cache-compression-test-cache-v6:077cd4b1a9a353fc2e41beb42b498264aef7287aed9675da9899238a4ddec6cc | jq -r '.layers[].mediaType'Result: application/vnd.oci.image.layer.v1.tar+gzip
Expected Behavior
Both cache and final image should use zstd:chunked compression as specified in containers.conf, regardless of whether --cache-to is used.
Actual Behavior
| Scenario | Cache | Final Image |
|---|---|---|
Build with --layers (no cache-to) |
N/A | zstd ✓ |
Build with --layers --cache-to |
gzip | gzip |
The --cache-to flag causes the entire compression_format setting to be ignored.
Environment
podman version 5.7.1
macOS with podman machine (Fedora CoreOS VM)
containers.conf location
/etc/containers/containers.conf in the podman machine VM
Related Issues
- Buildah reuse gzip layers when "--compression-format zstd" assigned #4613 - Buildah reuse gzip layers when "--compression-format zstd" assigned (fixed)
- When layering on top of a compressed image, podman build remove the layers compression and annotations podman#26088 - podman build removes layer compression when layering on compressed images
Test Images
The test images are publicly available for verification:
- Cache:
quay.io/jdanek/cache-compression-test-cache-v6 - Final (with cache-to, gzip):
quay.io/jdanek/cache-compression-test:v7 - Final (without cache-to, zstd):
quay.io/jdanek/cache-compression-test:v8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.