Layer caching does not work with --squash-all --layers using Containerfile #20229
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Issue Description
Problems:
Problem 1) layer cache with
--squash-all --layers
never works if Containerfile doesn't useCOPY --from
instruction.Example: this will rebuild every time (cache starts working if FROM/COPY lines are uncommented below):
Containerfile.base
Command:
$ time sh -c 'podman build -f Containerfile.base -t localhost/base --squash-all --layers'
Problem 2) layer cache
--squash-all --layers
breaks for the 2nd image (which uses 1st image as base) if the 1st image is rebuilt even though the 1st image was built from cache.Example: this sequence of commands will trigger rebuild for 2nd image every time (I don't have any workaround):
Containerfile.base
Containerfile.host
Commands:
time sh -c 'podman build -f Containerfile.base -t localhost/base --squash-all --layers && podman build -f Containerfile.host -t localhost/host --squash-all --layers'
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
--squash-all --layers
shouldn't requireCOPY --from
to workpodman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
N/A
Additional information
N/A
The text was updated successfully, but these errors were encountered: