-
Notifications
You must be signed in to change notification settings - Fork 483
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
ADD {url}
instruction incorrectly fetches different url from cache
#2803
Comments
It looks like there is a bug in both this specific server and also in the buildkit's caching logic.
Note that the Etag returned by the server is exactly the same. Etag should uniquely identify the resource. From buildkit side the question is why would buildkit even compare the etag if the URL itself has a difference. Atm the full URL is not used, but only the filename component. I think this is not ideal and even if server works correctly it could just make the more potential cache lookups that are unlikely to match. Looking at this debug output, I think we could also compare content-length to detect more cases where servers are behaving incorrectly. |
I checked out the source for api.adoptium.net and it is set to return the checksum of the entire "update" for every page that is cached, whatever that may be. Not sure if I should open an issue there or not. |
I'm not sure what "entire update" means in here, but different etag should be returned for different content. |
Me neither, it's just pulled from some database. |
Contributing guidelines
I've found a bug and checked that ...
Description
After fetching the url
https://api.adoptium.net/v3/assets/latest/8/hotspot?os=linux&architecture=x64&image_type=jdk
usingADD
in a Dockerfile, if in another Dockerfilehttps://api.adoptium.net/v3/assets/latest/21/hotspot?os=linux&architecture=x64&image_type=jdk
is fetched it will return the data from the previous url instead of from this url.Also see notes
Expected behaviour
The second ADD instruction properly fetches the second url.
Actual behaviour
The second ADD instruction incorrectly fetches the first url from cache.
Buildx version
github.com/docker/buildx v0.18.0 fa4461b, github.com/docker/buildx v0.17.1 257815a
Docker info
GitHub Actions:
My Comp:
Builders list
GitHub Actions:
My Comp:
Configuration
https://github.com/Kale-Ko/docker-bug-demo
Run
script.sh
Build logs
https://github.com/Kale-Ko/docker-bug-demo/commit/de76b1db5c538dd81a050e1bad8ad5ae44b72657/checks/33289867223/logs
Additional info
No response
The text was updated successfully, but these errors were encountered: