-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·56 lines (47 loc) · 1.24 KB
/
setup.sh
File metadata and controls
executable file
·56 lines (47 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
IMAGE_NAME="packet-harvester"
print_help() {
echo "📦 PacketHarvester - Docker Setup"
echo
echo "Usage:"
echo " ./setup.sh [command]"
echo
echo "Commands:"
echo " build Build the Docker image"
echo " clean Remove the Docker image"
echo " help, -h Show this help message"
echo
}
case "$1" in
build)
echo "🔍 Checking environment..."
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed."
exit 1
fi
if [[ ! -f "docker/Dockerfile" ]]; then
echo "❌ docker/Dockerfile not found. Are you in the correct directory?"
exit 1
fi
echo "🔧 Building Docker image '$IMAGE_NAME'..."
docker build -t "$IMAGE_NAME" ./docker
if [[ $? -eq 0 ]]; then
echo "✅ Build successful!"
else
echo "❌ Build failed."
exit 1
fi
;;
clean)
echo "🧹 Removing Docker image '$IMAGE_NAME'..."
docker rmi "$IMAGE_NAME"
;;
help|-h|--help|"")
print_help
;;
*)
echo "❌ Unknown command: $1"
print_help
exit 1
;;
esac