-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
podman image build does not hash bind mounts correctly #22450
Comments
@nalind @TomSweeneyRedHat can either of you comment on this ? |
Closing this as we switched to using docker instead of podman which in this case 2X faster. I think podman is not a good solution when context size is big, as it forces user to use Attaching hyperfine output for any future reference
|
It is unfortunate that this issue got closed as I'm running into a similar situation, but the opposite and am having trouble tracking down existing bug reports on it. My issue is that no matter what I do the RUN --mount=type=bind,source=my.tar.gz,target=/tmp/my.tar.gz,from=extra_context,z \
tar --no-same-owner --exclude some/big/dir -xf /tmp/my.tar.gz && \
chmod -R a+rX extracted_root/ No matter what I do this layer is not cached, but my understanding is that it should be if the tarball didn't change. I can create a separate issue if needed, but this particular issue seems related even if it is having the opposite result. Otherwise if someone can point me in the right direction, let me know. |
@djhoese we had to switch to using buildkit. Consider switching to it (either docker buildx plugin or buildctl inside podman) Basically this allowed us to obtain all the buildkit features when building images that we later use podman to run |
I recently noticed a behavior different than docker when podman builds an image.
Scenario
In the above scenario it is expected that the second image build command would be re-using the previous build layer, and output would be like the following
The strange thing happen if any of the content of the bind mount are changed for example
The above command should invalidate the second image layer, in podman it does not do this. Basically podman will re-use a stale layer in this case. And output will be as the following
In docker this behavior works as expected and layer would be invalid in this case given that the content of one of the files inside the bind mount source are changed.
My question is, how does one use bind mounts with podman while at the same time ensures it handles layer caching as expected?
Thank you
Originally posted by @elbehery95 in #21859
The text was updated successfully, but these errors were encountered: