-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Building with cache-from and BUILDKIT_INLINE_CACHE args breaks reproducible docker builds #1876
Comments
We're seeing this as well and would love a fix! |
Yes, by including the Works as expected without this flag enabled. |
I did some more investigation on this and found the following. The only config change between two builds with BUILDKIT_INLINE_CACHE=1 is to the When I unmarshal that key (base64) and format it with First image cache: [
{
"digest": "sha256:807b3e8722c68572736f54d83fd741a5b1d69ccbef218fae52b4149a56d232ce",
"inputs": [
[
{
"link": 3
}
]
]
},
{
"digest": "sha256:807b3e8722c68572736f54d83fd741a5b1d69ccbef218fae52b4149a56d232ce",
"inputs": [
[
{
"link": 4
}
]
]
}
] Second image cache: [
{
"digest": "sha256:807b3e8722c68572736f54d83fd741a5b1d69ccbef218fae52b4149a56d232ce",
"inputs": [
[
{
"link": 4
}
]
]
},
{
"digest": "sha256:807b3e8722c68572736f54d83fd741a5b1d69ccbef218fae52b4149a56d232ce",
"inputs": [
[
{
"link": 3
}
]
]
}
] I notice there is a method called buildkit/cache/remotecache/v1/utils.go Line 16 in 46c8b9e
I don't know enough however about the file format to know what the right fix is. There are some entries in the files that look like this: {
"digest": "sha256:c963489980ecadec4c2b06eb21b9d6d981669cb00c825aaf97831a79c5a4a5b5",
"inputs": [
[
{
"link": 1
},
{
"link": 2
}
]
]
} Is it valid to normalize those entries into a single object? Attaching both buildkit cache files in their entirety in case this helps. |
Seeing this issue where when we are using --cache-from and BUILDKIT_INLINE_CACHE=1 build args, we no longer have reproducible docker builds when there are no content changes. We see image ID changes with every build even when there are no content changes. If the BUILDKIT_INLINE_CACHE=1 build arg is removed then we do have reproducible builds and the image ID remains constant. Including a reproduction script below. Slack thread here
Reproduction bash script below, takes a remote registry repo as argument.
The text was updated successfully, but these errors were encountered: