代码拉取完成,页面将自动刷新
#!/bin/bash
echo "==========================================="
echo "Building KoalaWiki Docker Image with BuildKit Multi-platform"
echo "==========================================="
# Enable Docker Buildx with a new builder that supports multi-platform builds
docker buildx create --name multiplatform-builder --use
# Build frontend first
echo "Building frontend..."
pushd web-site > /dev/null
npm install
npm run build
popd > /dev/null
# Build and push backend images for multiple platforms at once (includes frontend static files)
echo "Building and pushing backend image with frontend for multiple platforms..."
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:latest \
-t crpi-j9ha7sxwhatgtvj4.cn-shenzhen.personal.cr.aliyuncs.com/koala-ai/koala-wiki:amd64 \
-f src/KoalaWiki/Dockerfile \
--push .
if [ $? -ne 0 ]; then
echo "Error building and pushing backend image!"
exit 1
fi
# Clean up the builder
docker buildx rm multiplatform-builder
echo "==========================================="
echo "Image built and pushed successfully!"
echo "==========================================="
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。