-
Notifications
You must be signed in to change notification settings - Fork 503
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
Permission denied errors using buildkit when Dockerfile is in directory with restricted files #1781
Comments
Further investigation reveals that the docker client is the one failing to open the folder:
|
Workaround (from @tonistiigi - thanks!) is to do:
|
@tiborvass We should make a temporary copy of Dockerfile always, (not only when set from stdin) and send the temp copy instead. |
/tmp
Also related docker/cli#1938 ping @tiborvass PTAL |
I'm still having this issue on Docker version 20.10.21, build baeda1f. Adding the folder to .dockerignore doesn't get around the problem. docker/cli#3043 describes my issue more accurately, but was closed in favour of this issue. |
@docker/build PTAL |
I had the same issue. Set DOCKER_BUILDKIT=0 works for me. |
Any updates on this? When running with sudo i run into ASL Logging error (other issue: docker/compose#9560). How do i set DOCKER_BUILDKIT to 0? I use fish shell |
@thaJeztah I think we can transfer this to https://github.com/docker/buildx (buildkit would be better, but we can't transfer between orgs 😢) I think this is due to the fact that before transferring any files to buildkit, the client walks all files in the local directory using fsutil: https://github.com/tonistiigi/fsutil/blob/9e7a6df4857652bc85225f55e2edb8aece3ecd43/send.go#L147-L168. To avoid the permissions error, we'd need to do some special error handling. However, this isn't just as simple as just ignoring files in those directories, we'd need to correctly propagate any errors for inaccessible files in case the dockerfile tries to access them. |
@jedevc yeah, this may be a tricky one, depending on the situation. Perhaps in some cases we can ignore the failure (i.e., if Let me transfer this one to the buildx repo. |
Steps to reproduce the issue:
/tmp
/tmp
too (e.g a systemd PrivateTmp folder)~/
) runDOCKER_BUILDKIT=1 docker build -f /tmp/Dockerfile .
Describe the results you received:
Describe the results you expected:
The image is built successfully without trying to open other files/folders in
/tmp
.Additional information you deem important (e.g. issue happens only occasionally):
Only happens with
DOCKER_BUIILDKIT=1
, if I'm not using buildkit, everything works fine.Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Running on a VirtualBox VM.
The text was updated successfully, but these errors were encountered: