-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With Dockerfile ADD .tar.xz reuses cache even when files changed #1906
Comments
First reported in containers/podman#3920. See that issue for further background information. We'll track the issue here going forward though. |
@shaicoleman I'm replicating now with upstream and latest. As you noted it should not cache. As a work around, you can add the
In the meantime I'll see if I can figure out why the build process isn't. |
FWIW this is a regression from podman 1.5.0 ( Also FWIW I was never able to reproduce containers/podman#3920 in v1.5.0, no matter what Dockerfile incantations I used. |
Add back the file checking mechanisms that were removed as part of the reworking of the cache in containers#1792. If we have a 'COPY mytar.tar.xz' command in the Containerfile and the tar file was regenerated after an intial build, secondary 'buildah bud' commands would use the cache from the first build for the tar file instead of regenerating it. The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287) does not seem to pick up this type of change and I wasn't able to quickly rework that to do so. We may want to revert back to this check for now, then tweak the historyMatches to work properly in a follow up PR. Regardless, I've added a test as part of this PR to catch this issue going forward. Fixes: containers#1906 Signed-off-by: TomSweeneyRedHat <[email protected]>
Add back the file checking mechanisms that were removed as part of the reworking of the cache in containers#1792. If we have a 'COPY mytar.tar.xz' command in the Containerfile and the tar file was regenerated after an intial build, secondary 'buildah bud' commands would use the cache from the first build for the tar file instead of regenerating it. The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287) does not seem to pick up this type of change and I wasn't able to quickly rework that to do so. We may want to revert back to this check for now, then tweak the historyMatches to work properly in a follow up PR. Regardless, I've added a test as part of this PR to catch this issue going forward. Fixes: containers#1906 Signed-off-by: TomSweeneyRedHat <[email protected]>
Add back the file checking mechanisms that were removed as part of the reworking of the cache in containers#1792. If we have a 'COPY mytar.tar.xz' command in the Containerfile and the tar file was regenerated after an intial build, secondary 'buildah bud' commands would use the cache from the first build for the tar file instead of regenerating it. The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287) does not seem to pick up this type of change and I wasn't able to quickly rework that to do so. We may want to revert back to this check for now, then tweak the historyMatches to work properly in a follow up PR. Regardless, I've added a test as part of this PR to catch this issue going forward. Fixes: containers#1906 Signed-off-by: TomSweeneyRedHat <[email protected]>
Add back the file checking mechanisms that were removed as part of the reworking of the cache in containers#1792. If we have a 'COPY mytar.tar.xz' command in the Containerfile and the tar file was regenerated after an intial build, secondary 'buildah bud' commands would use the cache from the first build for the tar file instead of regenerating it. The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287) does not seem to pick up this type of change and I wasn't able to quickly rework that to do so. We may want to revert back to this check for now, then tweak the historyMatches to work properly in a follow up PR. Regardless, I've added a test as part of this PR to catch this issue going forward. Fixes: containers#1906 Signed-off-by: TomSweeneyRedHat <[email protected]>
Try 2 after I accidentally nuked my sandbox for containers#1925 Add back the file checking mechanisms that were removed as part of the reworking of the cache in containers#1792. If we have a 'COPY mytar.tar.xz' command in the Containerfile and the tar file was regenerated after an intial build, secondary 'buildah bud' commands would use the cache from the first build for the tar file instead of regenerating it. The historyMatches() function (https://github.com/containers/buildah/blob/master/imagebuildah/executor.go#L287) does not seem to pick up this type of change and I wasn't able to quickly rework that to do so. We may want to revert back to this check for now, then tweak the historyMatches to work properly in a follow up PR. Regardless, I've added a test as part of this PR to catch this issue going forward. FWIW, with the exception of the test code, all of the code is a reversion to pre-existing code. Fixes: containers#1906 Signed-off-by: TomSweeneyRedHat <[email protected]>
@edsantiago do you have cycles to look at this and test? |
Regardless, I've added a test as part of this PR to catch this issue going forward. Fixes: containers#1906 Signed-off-by: TomSweeneyRedHat <[email protected]>
I believe this is fixed in current buildah, reopen if I am mistaken |
I suddenly started having this issue with
|
Could you try with podman 3.4 |
Ok I'm waiting for 3.4 to appear on https://build.opensuse.org/package/show/devel:kubic:libcontainers:stable/podman |
Description
Dockerfile ADD command reuses cache even when files have changed
Steps to reproduce the issue:
Dockerfile
Describe the results you expected:
It is expected not to reuse the cache if the files have changed.
Version:
The text was updated successfully, but these errors were encountered: