-
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathdu-cli.sh
More file actions
executable file
·79 lines (77 loc) · 1.54 KB
/
Copy pathdu-cli.sh
File metadata and controls
executable file
·79 lines (77 loc) · 1.54 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
76
77
78
79
#!/usr/bin/env bash
SCRIPT_ROOT=$(dirname "$(readlink -m "$(type -p "$0")")")
source "$SCRIPT_ROOT/docker-util.sh"
case $1 in
registry | reg | r)
case $2 in
start)
start-registry
;;
stop)
stop-registry
;;
host)
registry-host
;;
*)
echo "Unknown registry action \"$2\""
;;
esac
;;
image | img | i)
case $2 in
rev)
create-dummy-image "${@:3:2}"
;;
latest)
latest-image-rev "$3"
;;
rm)
remove-repo-images "$3"
;;
*)
echo "Unknown image action \"$2\""
;;
esac
;;
container | cnt | c)
case $2 in
query)
query-rev "$3"
;;
rm)
try-remove-container "$3"
;;
id)
container-id "$3"
;;
started)
container-started "$3"
;;
create)
create-container "${@:3:2}"
;;
create-stale)
if [ -z "$3" ]; then
echo "NAME missing"
exit 1
fi
if ! registry-exists; then
echo "Registry container missing! Creating..."
start-registry || exit 1
fi
image_name="images/$3"
container_name=$3
$0 image rev "$image_name" || exit 1
$0 container create "$container_name" "$image_name" || exit 1
$0 image rev "$image_name" || exit 1
;;
*)
echo "Unknown container action \"$2\""
;;
esac
;;
*)
echo "Unknown keyword \"$1\""
;;
esac