fix
Some checks failed
Add-in CI / Build and test Word add-in (push) Failing after 21s
Backend CI + Docker Deploy / Build and test backend (push) Failing after 37s
Web CI / Build and test web app (push) Failing after 5s
Backend CI + Docker Deploy / Build and push backend image (push) Has been skipped
Backend CI + Docker Deploy / Deploy backend container (push) Has been skipped

This commit is contained in:
Suphonchai Phoonsawat 2026-09-21 19:41:26 +07:00
parent 912bf9d0bd
commit 12bb9c9c21
9 changed files with 466 additions and 31 deletions

View file

@ -0,0 +1,60 @@
#!/bin/bash
# Build x86 Docker Image on Apple Silicon
# This script builds Docker image for x86/amd64 platform
set -e # Exit on any error
echo "🚀 Building x86 Docker image for KML Games..."
# Configuration
IMAGE_NAME="kml-games-admin"
TAG="${1:-latest}"
PLATFORM="linux/amd64"
echo "📋 Build Configuration:"
echo " Image Name: $IMAGE_NAME"
echo " Tag: $TAG"
echo " Platform: $PLATFORM"
echo ""
# Check if buildx is available
if ! docker buildx version > /dev/null 2>&1; then
echo "❌ Docker Buildx is required but not available."
echo " Please update Docker Desktop to latest version."
exit 1
fi
# Create builder if not exists
BUILDER_NAME="multiarch-builder"
if ! docker buildx inspect $BUILDER_NAME > /dev/null 2>&1; then
echo "🔧 Creating multiarch builder..."
docker buildx create --name $BUILDER_NAME --driver docker-container --bootstrap
docker buildx use $BUILDER_NAME
else
echo "✅ Using existing multiarch builder: $BUILDER_NAME"
docker buildx use $BUILDER_NAME
fi
# Build the image for x86 platform
echo "🔨 Building Docker image for $PLATFORM..."
docker buildx build \
--platform $PLATFORM \
--tag $IMAGE_NAME:$TAG \
--load \
.
echo ""
echo "✅ Build completed successfully!"
echo "📦 Image: $IMAGE_NAME:$TAG (x86/amd64)"
# Show image info
echo ""
echo "🔍 Image Information:"
docker image ls | grep $IMAGE_NAME
echo ""
echo "🎉 Ready to use! You can now:"
echo " • Run locally: docker run -p 5000:8080 $IMAGE_NAME:$TAG"
echo " • Push to registry: docker push your-registry/$IMAGE_NAME:$TAG"
echo " • Use in production on x86 servers"