You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What would you like to be added:
I would like to have an option to output the report (json) into a file with an option in the commad line like
grype "dir:/xxx" -o json -f report.json Why is this needed:
it's easier with this option to integrate grype in python code rather than running and getting the output with subprocess Additional context:
The text was updated successfully, but these errors were encountered:
@wagde-orca today we report all status output (e.g. "loading image", "parsing image", etc...) to stderr and all report data to stdout. In this way if you have an integration where you are trying to wrap grype and get the output you can safely grab all of stdout.
Using a redirect with bash:
# this will ignore all stderr status-like output
grype some-image:latest -o json > report.json
Or subprocess in python:
importsubprocessresult=subprocess.run(['grype', 'some-image:latest', '-o', 'json'], stdout=subprocess.PIPE)
result.stdout# <--- the full json report
Shout out if you were intending something different or if this doesn't fit your needs.
@wagoodman thanx
This is the way I do it right now and it is not so bad... but i still believe that having an option to dump the output to a file can be helpful
Tracking additional context from a duplicate issue #418:
What would you like to be added:
An official docker image for Grype that either has a shell, or an option to output findings to a file.
Why is this needed:
We're using Kubernetes native tooling for CI/CD (Tekton), and there isn't really an option to use Grype's official docker containers, because we need to output to a file, and it only outputs to stdout. Of course, an easy fix would be to just forward STDOUT to a file, but you can't do that in the docker container, because it has no shell.
What would you like to be added:
I would like to have an option to output the report (json) into a file with an option in the commad line like
grype "dir:/xxx" -o json -f report.json
Why is this needed:
it's easier with this option to integrate grype in python code rather than running and getting the output with subprocess
Additional context:
The text was updated successfully, but these errors were encountered: