-
Notifications
You must be signed in to change notification settings - Fork 481
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
Buildx does not allow oci-layout --context to be readonly. #2753
Comments
I can reproduce the problem with
Because it tries to create a file lock. Maybe you are on a system that doesn't support file locks, so you don't get that error. If I suppress error with file locks and don't have |
i see that could be useful as a workaround, makes sense to create that folder when creating the oci-layout, i'll look into that but it would be great if this was fixed here.
oh the reason i don't get the Line 508 in 746eadd
|
Thank you @tonistiigi, i can confirm that creating |
The lock side of this has been fixed in buildx v0.18.0 , the "ingest" side will need to wait for containerd libs update. |
Contributing guidelines
I've found a bug and checked that ...
Description
Currently when attaching an oci-layout context to buildx, it wants to create some lock/ingest files within the target directory even though those files are not used in an meaningful way in this instance as far as in can see.
Here it wants to create
index.json.lock
if the digest is not providedbuildx/build/opt.go
Line 509 in 746eadd
And here if you provide a tag.
buildx/build/opt.go
Line 514 in 746eadd
Context:
I am trying to build a Bazel ruleset to allow running buildx under Bazel, and to attach contexts to buildx so it can be copied into the resulting container, however, as a accidental write prevention measure, Bazel marks artifacts from other build rules as readonly which is where buildx fails because it assumes the stores to be writeable even though it does not need them to be writable in this instance.
Expected behaviour
I'd expect the oci-layout store to not create these ingestion/lock files eagerly.
Actual behaviour
oci-layout store creates ingest/lock files eagerly preventing the directories to be marked readonly.
Buildx version
v0.17.1
Docker info
No response
Builders list
Configuration
Build logs
Additional info
FWIW, i filed this issue in containerd repo containerd/containerd#10885 as one of the offending library seems to be coming from there.
The text was updated successfully, but these errors were encountered: