-
Notifications
You must be signed in to change notification settings - Fork 44
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
Cleanup temp directories across image providers #132
Comments
+1 on this - we noticed abnormal disk usage when utilizing syft and narrowed down the issue to this root cause as well. |
I think this is an interesting problem. There are a few options here:
Personally I am a fan of option 1... but would like a recommendations from the team - I am happy to open a PR with a little guidance |
nm... I think I was wrong. Based on a further research - only thing really needed is to call client.go The comment above cleanup is misleading and what leads to the leak of files I believe. |
I've just run into this myself - was using Switching to |
I did a little digging this weekend and discovered the following:
This feels like an incomplete chain of responsibility. Because the IMHO - A better solution is to complete the chain of responsibility but having If providers make a new generators, or directories, they are all passed to the image for cleanup after the image is no longer needed. |
* fix tmpDirGenerator chain of responsibility associated with #132 Signed-off-by: Joseph Barnett <[email protected]> Signed-off-by: [email protected] <[email protected]> * reduce log message to debug Signed-off-by: Joseph Barnett <[email protected]> Signed-off-by: [email protected] <[email protected]> * restore global cleanup function Signed-off-by: Alex Goodman <[email protected]> --------- Signed-off-by: Joseph Barnett <[email protected]> Signed-off-by: [email protected] <[email protected]> Signed-off-by: Alex Goodman <[email protected]> Co-authored-by: Alex Goodman <[email protected]>
* fix tmpDirGenerator chain of responsibility associated with anchore#132 Signed-off-by: Joseph Barnett <[email protected]> Signed-off-by: [email protected] <[email protected]> * reduce log message to debug Signed-off-by: Joseph Barnett <[email protected]> Signed-off-by: [email protected] <[email protected]> * restore global cleanup function Signed-off-by: Alex Goodman <[email protected]> --------- Signed-off-by: Joseph Barnett <[email protected]> Signed-off-by: [email protected] <[email protected]> Signed-off-by: Alex Goodman <[email protected]> Co-authored-by: Alex Goodman <[email protected]>
What happened:
See docker/sbom-cli-plugin#22 for the original problem; invocations of
docker sbom
(which uses the docker daemon provider) are not cleaning up temp files.What you expected to happen:
All temp directories should be cleaned up.
How to reproduce it (as minimally and precisely as possible):
docker sbom alpine:latest
andls
the temp directory to see that there aresbom-cli-plugin-*
directories still left (docker sbom
uses stereoscope).Anything else we need to know?:
Today the docker daemon provider uses the tarball provider, each create sibling temp directories under a common root directory. We should be cleaning up the
image.tar
as soon as we create and provide an image from the tarball provider (from within the docker daemon provider --downside is that multiple calls to provide() will fail then [which hints that another solution may be needed here] ).The text was updated successfully, but these errors were encountered: