Skip to content

Commit 1fd67fe

Browse files
authored
更新脚本
1 parent 8acca73 commit 1fd67fe

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

.github/workflows/docker-image.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@ jobs:
1414
run: docker login -u "${{ secrets.DOCKER_USERNAME }}" crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com --password="${{ secrets.DOCKER_PASSWORD }}"
1515
- name: Build Backend Image
1616
run: ./build-image.sh
17-
- name: Push Images
18-
run: |
19-
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki
20-
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki-web
21-
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:arm64
22-
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki-web:arm64
17+

build-image.sh

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,84 @@ docker buildx build \
1313
--platform linux/amd64 \
1414
-t crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki \
1515
-f src/KoalaWiki/Dockerfile \
16-
--push .
16+
--load .
1717
if [ $? -ne 0 ]; then
1818
echo "Error building backend amd64 image!"
1919
exit 1
2020
fi
2121

22+
# Push backend amd64 image
23+
echo "Pushing backend amd64 image..."
24+
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki
25+
if [ $? -ne 0 ]; then
26+
echo "Error pushing backend amd64 image!"
27+
exit 1
28+
fi
29+
2230
# Build backend image specifically for arm64 platform using Dockerfile.arm
2331
echo "Building backend image for arm64 platform using Dockerfile.arm..."
2432
docker buildx build \
2533
--platform linux/arm64 \
2634
-t crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:arm64 \
2735
-f src/KoalaWiki/Dockerfile.arm \
28-
--push .
36+
--load .
2937
if [ $? -ne 0 ]; then
3038
echo "Error building backend arm64 image!"
3139
exit 1
3240
fi
3341

42+
# Push backend arm64 image
43+
echo "Pushing backend arm64 image..."
44+
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:arm64
45+
if [ $? -ne 0 ]; then
46+
echo "Error pushing backend arm64 image!"
47+
exit 1
48+
fi
49+
3450
# Build frontend image for amd64 platform
3551
echo "Building frontend image for amd64 platform..."
3652
pushd web > /dev/null
3753
docker buildx build \
3854
--platform linux/amd64 \
3955
-t crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki-web \
4056
-f Dockerfile \
41-
--push .
57+
--load .
4258
if [ $? -ne 0 ]; then
4359
echo "Error building frontend amd64 image!"
4460
exit 1
4561
fi
62+
63+
# Push frontend amd64 image
64+
echo "Pushing frontend amd64 image..."
65+
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki-web
66+
if [ $? -ne 0 ]; then
67+
echo "Error pushing frontend amd64 image!"
68+
exit 1
69+
fi
4670
popd > /dev/null
4771

4872
# Build frontend image for arm64 platform
49-
# Note: This assumes frontend might also need special handling for arm64
5073
echo "Building frontend image for arm64 platform..."
5174
pushd web > /dev/null
5275
docker buildx build \
5376
--platform linux/arm64 \
5477
-t crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki-web:arm64 \
5578
-f Dockerfile.arm \
56-
--push .
79+
--load .
5780
if [ $? -ne 0 ]; then
5881
echo "Error building frontend arm64 image!"
5982
exit 1
6083
fi
84+
85+
# Push frontend arm64 image
86+
echo "Pushing frontend arm64 image..."
87+
docker push crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki-web:arm64
88+
if [ $? -ne 0 ]; then
89+
echo "Error pushing frontend arm64 image!"
90+
exit 1
91+
fi
6192
popd > /dev/null
6293

6394
echo "==========================================="
6495
echo "Images built and pushed successfully!"
65-
echo "==========================================="
96+
echo "==========================================="

0 commit comments

Comments
 (0)