-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathdocker-upgrade.sh
More file actions
51 lines (45 loc) · 1.04 KB
/
Copy pathdocker-upgrade.sh
File metadata and controls
51 lines (45 loc) · 1.04 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
#!/bin/bash
# 初始化标志变量
PULL_IMAGES=false
DEMO_MODE=false
# 解析命令行参数
for arg in "$@"
do
case $arg in
--pull)
PULL_IMAGES=true
shift
;;
--demo)
DEMO_MODE=true
shift
;;
*)
echo "Unknown argument: $arg"
exit 1
;;
esac
done
# 停止并移除现有容器
echo "Stopping all services..."
docker compose down --remove-orphans
echo "Stopped all services..."
# 拉取镜像
if [ "$PULL_IMAGES" = true ]; then
echo "Pulling latest images..."
docker compose pull
echo "Pulled latest images..."
fi
if [ "$DEMO_MODE" = true ]; then
# 启用 demo 模式
export DEMO_MODE=true
echo "Starting services for demo mode..."
# 启动指定的服务
docker compose up -d --remove-orphans mysql redis ui service guacd influxdb adminer
echo "Started services for demo mode..."
else
# 启动所有服务
echo "Starting all services..."
docker compose up -d --remove-orphans
echo "Started all services..."
fi