Open pckvcode opened 2 weeks ago
Hi @pckvcode thanks for the request! This is an enhancement we'd be happy to see.
In the meantime os.TempDir
respects the usual environment variables for choosing the temp directory, e.g. TMPDIR
on mac and Linux, so this might help your use case.
What would you like to be added: Providing an option to mention tempDirectory instead of relying on tmp directory provided by os.TempDir when GetImage https://github.com/anchore/stereoscope/blob/e6d086e8bef5fab4fcfbd60c9a759c4cb229decf/client.go#L69
Why is this needed: We had a requirement where a customer wants to mention tempDirectory to be used by stereoscope while getting a docker image.
Additional context:
I examined the Stereoscope code to see if we could set a custom tempDir, but currently, that option isn’t available.
Here we are using global variable
rootTempDirGenerator
and not exposed to change. https://github.com/anchore/stereoscope/blob/e6d086e8bef5fab4fcfbd60c9a759c4cb229decf/client.go#L19Can we provide an option to update rootLocation in TempDirGenerator https://github.com/anchore/stereoscope/blob/e6d086e8bef5fab4fcfbd60c9a759c4cb229decf/pkg/file/temp_dir_generator.go#L12