feat(container): use .trivyignore file when validation image with trivy

This commit is contained in:
wpetit 2023-11-17 14:01:45 +01:00
parent 0ac529eac7
commit fca4ac23d6
1 changed files with 1 additions and 1 deletions

View File

@ -198,7 +198,7 @@ String validateImageWithTrivy(String imageName, Map options = [:]) {
cache(maxCacheSize: cacheMaxSize, defaultBranch: cacheDefaultBranch, caches: [
[$class: 'ArbitraryFileCache', path: cacheDirectory, compressionMethod: 'TARGZ']
]) {
sh("'${trivyBin}' --cache-dir '${cacheDirectory}' image --format template --template '@.trivy-markdown.tpl' -o '${reportFile}' ${trivyArgs} '${imageName}'")
sh("'${trivyBin}' --cache-dir '${cacheDirectory}' image --ignorefile .trivyignore.yaml --format template --template '@.trivy-markdown.tpl' -o '${reportFile}' ${trivyArgs} '${imageName}'")
}
return reportFile