[Containerfile] HEREDOC with RUN instruction does not invalidate cache #21498
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
HEREDOC is useful for providing a clean syntax in Contailerfile. It allows you to create multi-line commands which supports comments without the need of using any special operators like
&&
.However, the cache does not get invalidated if you update a cached HEREDOC
RUN
instruction inContainerfile
:Steps to reproduce the issue
Create a
RUN
instruction using HEREDOC:$ podman build -t localhost/test/heredoc:latest -f ./Containerfile
Add a new command to an existing HEREDOC
RUN
instruction:$ podman build -t localhost/test/heredoc:latest -f ./Containerfile
Describe the results you received
Using the above example,
echo 3
is never executed.Describe the results you expected
Changes to any
RUN
instruction should invalidate the cache even if it uses HEREDOC.This issue can lead to a lot of confusion and frustration when pushing code into production which uses HEREDOC.
podman info output
Podman in a container
No
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
Related: containers/buildah#3474
Additional information
To workaround this issue, simply change the name of the HEREDOC (
EXE
->V2
):The text was updated successfully, but these errors were encountered: