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
[v26] Build caching with type=cache
mounts
#47693
Comments
Hm, I can double-check with the BuildKit maintainers, but I don't think the content of the mount should make a difference w.r.t. the build-cache; the expectation for cache is that the
In other words, |
In general, I would definitely recommend combining |
Had a quick chat on Slack, and it looks like there was a previous bug that caused the |
If it was a bug, it was an absolutely amazing one. For me, it solves the problem of building multiple images that look the same on the local machine at the same time. In CI, I build each image in a separate namespace so they don't overlap. Here are some examples
|
The parts that depend on env-vars / build-args should still be invalidated if those parameters are different. I'm curious though why the common steps should be executed again in your situation? If the problem is that the Can you describe for which steps in your example you expected the cache to be invalidated, but that not happening? (And how they differ between the different Dockerfiles (or same Dockerfile, but different parameters)? |
I didn't design my dockerfiles for cache invalidation. On localhost I just remove the build cache. In CI I don't use build cache at all. |
Why is it using "type=cache" for mounting the content of "downloader"? |
Description
In moby v26.0.0 layers could be cached if side effect is stored in
--mount=type=cache
with differentid
, thus changing the previous behavior.Reproduce
Dockerfile
docker build --progress plain --target b1 .
docker build --progress plain --target b2 .
Expected behavior
Both targets should be built.
docker version
docker info
Additional Info
I bisect the repo to get the list of suggested bad commits.
git bisect log
The text was updated successfully, but these errors were encountered: