Skip to content

Commit e28b0d1

Browse files
committed
build and scan script
1 parent ede5400 commit e28b0d1

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.tar
2+
*.html

build-scan.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Check dependencies
6+
for cmd in podman osv-scanner; do
7+
if ! command -v "$cmd" &> /dev/null; then
8+
echo "Error: $cmd is not installed." >&2
9+
exit 1
10+
fi
11+
done
12+
13+
# Check if podman machine is running
14+
if ! podman info &> /dev/null; then
15+
echo "Podman machine is not running. Starting it now..."
16+
podman machine start
17+
echo "Podman machine started."
18+
fi
19+
20+
echo "Building container image..."
21+
podman build . -t "localhost/novnc:latest"
22+
23+
echo "Saving container image to novnc.tar..."
24+
podman save --format=docker-archive "localhost/novnc:latest" > novnc.tar
25+
26+
echo "Scanning image with OSV-Scanner..."
27+
osv-scanner scan image --format html --archive novnc.tar > osv-scan.html
28+
29+
echo "Scan complete. Report saved to osv-scan.html"

0 commit comments

Comments
 (0)