-
Notifications
You must be signed in to change notification settings - Fork 782
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
build, run: record hash or digest in image history for sources used in --mount
#5691
base: main
Are you sure you want to change the base?
Conversation
When using `--mount=type=bind` or `--mount=type=cache` the hash or digest of source in these flags should be added to image history so buildah can burst cache if files on host or image which is being used as source is changed. Signed-off-by: flouthoc <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Need to add tests, will undraft then. |
Will rebase after this #5693 |
I'm surprised that we'd care about the contents of caches. I'd be inclined to archive the contents of a directory (and create a single-entry archive for a non-directory) to account for different permissions/ownership/datestamps/xattrs and to safely handle soft and hard links. |
If i'm understanding this correctly, did you mean instead of |
I wouldn't expect the archive to be written anywhere, but the digest of an archive is something we already use as a way of describing contents, when handling COPY and ADD instructions. I don't know yet about doing this over the entire build context or additional build context if only a portion of it is being used at that point (i.e., if "src" is set to a subdirectory). |
This sounds good to me, i will amend the PR. |
I'm seeing this behavior with ARG PATH_1=mydirectory
ARG SELINUXRELABEL=,z
ARG DISTRO=PATH_1
RUN --mount=type=bind,source=${PATH_1:?},target=/tmp/${PATH_1:?}${SELINUXRELABEL:?} \
echo Nop Subsequently, |
@sanmai-NL Are contents of |
Thanks for your response. Yes indeed, they do end up in there, which I find surprising. And which is the reason for my comment. Some factors which may cause this in case the problem isn't general |
Re-reading your comment... So you do find this ending up in a layer by-design, do you? But this way, information leaks and the image bloats. |
@sanmai-NL What you are describing is a different bug, would it be possible to create a small reproducer and open a new issue ? |
A friendly reminder that this PR had no activity for 30 days. |
When using
--mount=type=bind
or--mount=type=cache
the hash or digest of source in these flags should be added to image history so buildah can burst cache if files on host or image which is being used as source is changed.Closes
podman build
not invalidating layers after a change in a--mount=type=bind
directory podman#23382What type of PR is this?
What this PR does / why we need it:
How to verify it
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?