Update
This commit is contained in:
30
build-docker-image.sh
Normal file → Executable file
30
build-docker-image.sh
Normal file → Executable file
@ -1,4 +1,32 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Build Docker image for Voice RSS Summary project
|
||||
docker build -t voice-rss-summary .
|
||||
# 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"
|
||||
|
Reference in New Issue
Block a user