-
Notifications
You must be signed in to change notification settings - Fork 545
build from stdin leaves behind temp-files #3117
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
Comments
Ideally, no empty tempdir nor temporary Dockerfile is created (pretty please) |
Ah, sure, agreed! Not sure if there's technical limitations to do so, but if there aren't, then 💯 🤔 After I opened this ticket, I realised I didn't check if this reproduces when invoking Let me check that as well! |
I recalled I didn't try this yet; I just tried reproducing with buildx directly, so invoking docker run -it --rm --name dockercontainer -v /var/run/docker.sock:/var/run/docker.sock docker:cli
docker buildx version
github.com/docker/buildx v0.23.0 28c90eadc4c12cc78155ad59ca5f486220241d2a
echo -e 'FROM alpine\nRUN echo hello\n' | /usr/local/libexec/docker/cli-plugins/docker-buildx build -t foo --load -
# ...
echo -e 'FROM alpine\nRUN echo hello\n' | /usr/local/libexec/docker/cli-plugins/docker-buildx build -t foo --load -
# ... / # ls -lR /tmp
/tmp:
total 16
drwx------ 2 root root 4096 Apr 19 12:47 dockerfile3833159354
drwx------ 2 root root 4096 Apr 19 12:47 dockerfile3987088253
drwx------ 2 root root 4096 Apr 19 12:47 empty-dir268969896
drwx------ 2 root root 4096 Apr 19 12:47 empty-dir3246528327
/tmp/dockerfile3833159354:
total 4
-rw-r--r-- 1 root root 28 Apr 19 12:47 Dockerfile
/tmp/dockerfile3987088253:
total 4
-rw-r--r-- 1 root root 28 Apr 19 12:47 Dockerfile
/tmp/empty-dir268969896:
total 0
/tmp/empty-dir3246528327:
total 0 |
Oh! I missed that Tonis opened a PR to fix it (thanks!); |
Contributing guidelines
I've found a bug and checked that ...
Description
Noticed this when testing a pull request, and looking at
docker diff
for the container in which I ran a docker build;Check the temp directory inside the container;
/ # ls -lR /tmp /tmp: total 24 drwx------ 2 root root 4096 Apr 15 20:25 dockerfile172585709 drwx------ 2 root root 4096 Apr 15 20:24 dockerfile1964065413 drwx------ 2 root root 4096 Apr 15 20:25 dockerfile4067550684 drwx------ 2 root root 4096 Apr 15 20:25 empty-dir3096975124 drwx------ 2 root root 4096 Apr 15 20:24 empty-dir4076683267 drwx------ 2 root root 4096 Apr 15 20:25 empty-dir4193758908 /tmp/dockerfile172585709: total 4 -rw-r--r-- 1 root root 28 Apr 15 20:25 Dockerfile /tmp/dockerfile1964065413: total 4 -rw-r--r-- 1 root root 28 Apr 15 20:24 Dockerfile /tmp/dockerfile4067550684: total 4 -rw-r--r-- 1 root root 28 Apr 15 20:25 Dockerfile /tmp/empty-dir3096975124: total 0 /tmp/empty-dir4076683267: total 0 /tmp/empty-dir4193758908: total 0
Expected behaviour
Ideally, for buildx to cleanup the temporary files after the build completes
Actual behaviour
Temp-files are left behind for each build.
Buildx version
docker buildx version github.com/docker/buildx v0.22.0 18ccba0
Docker info
Builders list
Configuration
See above
Build logs
Additional info
No response
The text was updated successfully, but these errors were encountered: