chore: update Dockerfile and rename build script for multi-architecture support

This commit is contained in:
MauroDruwel
2026-05-23 11:34:54 +02:00
parent 345a64f51a
commit 98d13c6569
2 changed files with 3 additions and 1 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# build.sh — Build Open Ticket Docker images for all supported architectures.
#
# Usage: ./build.sh <image> [--no-push]
# image Full image name, e.g. djj123dj/open-ticket
#
# Example: ./build.sh djj123dj/open-ticket --no-push
set -euo pipefail
IMAGE="${1:?Usage: ./build.sh <image> [--no-push]}"
PLATFORMS="linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64" # linux/s390x is taking too long to build, so we'll skip it for now
VERSION=$(node -p "require('./package.json').version")
# Create a multi-arch builder if it doesn't exist yet
docker buildx inspect ot-builder &>/dev/null \
|| docker buildx create --name ot-builder --driver docker-container --bootstrap --use
docker buildx use ot-builder
PUSH_FLAG="--push"
[[ "${2:-}" == "--no-push" ]] && PUSH_FLAG=""
docker buildx build \
--platform "$PLATFORMS" \
--tag "${IMAGE}:v${VERSION}" \
--tag "${IMAGE}:latest" \
$PUSH_FLAG \
.
[[ -n "$PUSH_FLAG" ]] \
&& echo "✓ Pushed ${IMAGE}:v${VERSION} and ${IMAGE}:latest" \
|| echo "✓ Built ${IMAGE}:v${VERSION} (not pushed)"