Skip to content

Instantly share code, notes, and snippets.

@doshyt
Last active July 15, 2021 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doshyt/f3f1b6d6926a9db35d5f04c46e43df04 to your computer and use it in GitHub Desktop.
Save doshyt/f3f1b6d6926a9db35d5f04c46e43df04 to your computer and use it in GitHub Desktop.
Run Trivy scan from dockerimage with mounting .trivyignore file
#!/bin/bash
imageRepository="python"
version="3.4-alpine"
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/.trivyignore:/tmp/.trivyignore \
aquasec/trivy image \
--ignorefile /tmp/.trivyignore \
--no-progress --exit-code 1 \
${imageRepository}:${version}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment