-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathentrypoint.sh
More file actions
75 lines (62 loc) · 1.86 KB
/
entrypoint.sh
File metadata and controls
75 lines (62 loc) · 1.86 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
set -e
# Set default grml-live path
GRML_LIVE_PATH="/opt/grml-live"
# Add grml-live to PATH
export PATH="$GRML_LIVE_PATH:$PATH"
# Check if user provided custom grml-live-grml checkout
if [ -d "/opt/grml-live-grml" ] && [ "$(ls -A /opt/grml-live-grml 2>/dev/null)" ]; then
echo "Using custom grml-live-grml checkout from /opt/grml-live-grml"
export GRML_LIVE_GRML_PATH="/opt/grml-live-grml"
fi
# Function to show help
show_help() {
cat << EOF
grml-live Docker Container
Usage:
docker run [docker-options] <image> <command> [args...]
Commands:
grml-live [args...] Run grml-live with specified arguments
build [args...] Run build-driver/build with specified arguments
help Show this help message
Examples:
# Run grml-live (mount output directory)
docker run --rm -v "\$PWD:/workspace" \\
<image> grml-live -f GRMLBASE -o /workspace/output
# Run build-driver (mount workspace for config and output)
docker run --rm -v "\$PWD:/workspace" \\
<image> build daily /workspace/config/daily full arm64 testing
# Mount custom grml-live checkout
docker run --rm -v "\$PWD:/workspace" \\
-v /path/to/grml-live:/opt/grml-live \\
<image> grml-live [args...]
# Mount custom grml-live-grml checkout
docker run --rm -v "\$PWD:/workspace" \\
-v /path/to/grml-live:/opt/grml-live \\
-v /path/to/grml-live-grml:/opt/grml-live-grml \\
<image> grml-live [args...]
EOF
}
# Parse the first argument and execute accordingly
case "$1" in
"grml-live")
shift
exec grml-live "$@"
;;
"build")
shift
exec "$GRML_LIVE_PATH/build-driver/build" "/opt/grml-live" "$@"
;;
"help"|"--help"|"-h")
show_help
;;
"")
show_help
;;
*)
echo "Unknown command: $1"
echo ""
show_help
exit 1
;;
esac