fix: use memory cache backend for parallel trivy scans

Parallel trivy image workers sharing the fs cache directory hit
"cache may be in use by another process: timeout" errors. Switch to
--cache-backend memory to avoid bolt-db lock contention, matching the
approach already used in generate-sbom.sh.
This commit is contained in:
ychangkim
2026-07-20 18:12:19 +09:00
parent 9a434bb27a
commit a1e726b755
+1 -1
View File
@@ -103,7 +103,7 @@ jobs:
img="$1"; reports="$2" img="$1"; reports="$2"
safe=$(printf "%s" "$img" | tr "/:@" "___") safe=$(printf "%s" "$img" | tr "/:@" "___")
echo ">> 스캔: $img" echo ">> 스캔: $img"
trivy image --quiet --skip-db-update \ trivy image --quiet --cache-backend memory --skip-db-update \
--format json --timeout 15m --output "$reports/$safe.json" "$img" \ --format json --timeout 15m --output "$reports/$safe.json" "$img" \
|| echo "::warning::스캔 실패: $img" || echo "::warning::스캔 실패: $img"
' _ {} "$REPORTS_DIR" < "$OUT_DIR/images_scan.txt" ' _ {} "$REPORTS_DIR" < "$OUT_DIR/images_scan.txt"