#!/bin/bash set -euo pipefail # Build Docker image for Voice RSS Summary project # Usage: ./build-docker-image.sh [tag] [build-args...] IMAGE_NAME="voice-rss-summary" TAG="${1:-latest}" FULL_TAG="${IMAGE_NAME}:${TAG}" echo "Building Docker image: ${FULL_TAG}" echo "Build context: $(pwd)" # Check if Dockerfile exists if [[ ! -f "Dockerfile" ]]; then echo "Error: Dockerfile not found in current directory" exit 1 fi # Build with build cache and progress output docker build \ --tag "${FULL_TAG}" \ --progress=plain \ --build-arg BUILDKIT_INLINE_CACHE=1 \ "${@:2}" \ . # Display image info echo "\nBuild completed successfully!" echo "Image: ${FULL_TAG}" echo "Size: $(docker images --format 'table {{.Size}}' "${FULL_TAG}" | tail -n +2)" echo "\nTo run the container, use: ./run-docker.sh"