Closed gergelyfabian closed 7 months ago
You can try setting DOCKER_SCOUT_CACHE_DIR
env var to have docker scout
use a different cache location. Alternatively, you can also disable caching completely with DOCKER_SCOUT_NO_CACHE
.
Let me know if that works.
Tried both:
DOCKER_SCOUT_CACHE_DIR=$TEST_TMPDIR/scout_cache docker scout cves ...
DOCKER_SCOUT_NO_CACHE=true docker scout cves ...
The error I get is (the same whether I provide these env vars or not):
ERROR Status: failed create to sbom folder: mkdir /home/user/.docker/scout/sbom/sha256/a94bfdf20e311ab7b601639db53512dec6f3debbe10d0fdca8de3527d1e64766: read-only file system, Code: 1
version: v1.2.0 (go1.21.3 - linux/amd64)
git commit: 4f69249fb62a3d644dbaf7d9ddb3046e3b8bd35c
Thanks for reporting back. Let me take a look at this more.
Opps, I see what's wrong here. Let me push a fix.
Opps, I see what's wrong here. Let me push a fix.
Thank you so much!
How could I test the fix?
Fix pushed. Waiting for release now.
Version 1.2.1 is now released.
After upgrading to 1.2.1 it works with:
export DOCKER_SCOUT_CACHE_DIR=$TEST_TMPDIR/scout_cache
It doesn't work though with:
export DOCKER_SCOUT_NO_CACHE=true
Could these env vars be added to documentation? I see it mentioned in the docker scout cache df
documentation, but it's not mentioned for other commands or the general docs.
Also, I guess it would be useful to add a mention for them in the error message if the SBOM file could not be written due to file system permission errors.
@gergelyfabian I've added docs about the available env vars to https://github.com/docker/scout-cli/blob/main/README.md#environment-variables. This will also be added to the official docs at docs.docker.com soon.
export DOCKER_SCOUT_NO_CACHE=true
Yes, saw that too and already pushed a fix. Previously this env var was only not reading from the cache but we were still attempting to write. This will be fixed in the next version.
Thank you for all the fixes!
I'm trying to use
docker scout
from a Bazel test target, that gives restricted access to a user's home directory. Thus,docker scout
fails with a similar error:Is there a way to reconfigure
docker scout
to write temporary files or cached files into a different location? If this is not currently supported, could you provide some link to source code where this could be added (maybe I could contribute it).