Skip to content

Commit 3c08df6

Browse files
committed
Add multi-platform support to build script by creating a dedicated buildx builder
1 parent 3c58b94 commit 3c08df6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

build.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
#!/bin/bash
22

3+
# Create and use a buildx builder that supports multi-platform builds
4+
BUILDER_NAME="multiarch"
5+
6+
# Remove old builder if it exists (e.g., from previous Docker context like Rancher Desktop)
7+
if docker buildx ls | grep -q "$BUILDER_NAME"; then
8+
docker buildx rm "$BUILDER_NAME" 2>/dev/null || true
9+
fi
10+
11+
# Create new builder with current Docker context (Colima)
12+
docker buildx create --name "$BUILDER_NAME" --driver docker-container --use
13+
docker buildx inspect --bootstrap
14+
315
docker buildx build . --tag kiskolabs/postgres-fi:latest --platform linux/amd64,linux/arm64 --push

0 commit comments

Comments
 (0)