#!/bin/bash

# Build script for Freeleaps PVC Backup Docker image

set -e

# Configuration
IMAGE_NAME="freeleaps-pvc-backup"
REGISTRY="freeleaps-registry.azurecr.io"
TAG="${1:-latest}"

echo "Building Freeleaps PVC Backup Docker image..."
echo "Image: ${REGISTRY}/${IMAGE_NAME}:${TAG}"

# Build the Docker image
docker buildx build \
  --platform linux/amd64 \
  -f Dockerfile \
  -t "${REGISTRY}/${IMAGE_NAME}:${TAG}" \
  .

echo "Build completed successfully!"
echo "To push the image, run:"
echo "docker push ${REGISTRY}/${IMAGE_NAME}:${TAG}" 