-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild-multiarch.sh
More file actions
executable file
·68 lines (56 loc) · 1.65 KB
/
build-multiarch.sh
File metadata and controls
executable file
·68 lines (56 loc) · 1.65 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
#!/bin/bash
# Bella Workflow 多架构Docker构建脚本,专用于GitHub Actions
set -e
REGISTRY=${1:-bellatop}
VERSION=${2:-latest}
PLATFORMS="linux/amd64,linux/arm64"
echo "构建 Bella Workflow 多架构Docker镜像..."
echo "仓库: $REGISTRY"
echo "版本: $VERSION"
echo "平台: $PLATFORMS"
# 清理旧的构建器(如果存在)
echo "清理旧的构建器..."
docker buildx rm multibuilder 2>/dev/null || true
# 设置buildx
echo "创建新的构建器..."
docker buildx create --name multibuilder --driver docker-container --bootstrap --use
# 清理构建缓存
echo "清理构建缓存..."
docker buildx prune -f
# 构建API镜像
echo "构建API镜像..."
docker buildx build \
--platform $PLATFORMS \
--build-arg VERSION=$VERSION \
--build-arg REGISTRY=$REGISTRY \
--no-cache \
-t $REGISTRY/bella-workflow-api:$VERSION \
-t $REGISTRY/bella-workflow-api:latest \
-f api/Dockerfile \
--push .
# 构建Web镜像
echo "构建Web镜像..."
docker buildx build \
--platform $PLATFORMS \
--build-arg VERSION=$VERSION \
--build-arg REGISTRY=$REGISTRY \
--no-cache \
-t $REGISTRY/bella-workflow-web:$VERSION \
-t $REGISTRY/bella-workflow-web:latest \
-f web/Dockerfile \
--push .
# 构建Tasks镜像
echo "构建Tasks镜像..."
docker buildx build \
--platform $PLATFORMS \
--build-arg VERSION=$VERSION \
--build-arg REGISTRY=$REGISTRY \
--no-cache \
-t $REGISTRY/bella-workflow-tasks:$VERSION \
-t $REGISTRY/bella-workflow-tasks:latest \
-f tasks/Dockerfile \
--push .
# 清理构建器
echo "清理构建器..."
docker buildx rm multibuilder 2>/dev/null || true
echo "✅ 所有模块多架构镜像构建完成"