29 lines
599 B
Bash
Executable File
29 lines
599 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Script to build and push Docker image
|
|
# Usage: ./scripts/build-and-push.sh [registry] [tag]
|
|
|
|
set -e
|
|
|
|
REGISTRY=${1:-docker.io}
|
|
USERNAME=${2:-biohazardvfx}
|
|
IMAGE_NAME=${3:-website}
|
|
TAG=${4:-latest}
|
|
|
|
# Full image name
|
|
IMAGE="$REGISTRY/$USERNAME/$IMAGE_NAME:$TAG"
|
|
|
|
echo "Building Docker image: $IMAGE"
|
|
|
|
# Build the image
|
|
docker build -t "$IMAGE" .
|
|
|
|
echo "Image built successfully!"
|
|
|
|
# Optional: Push to registry (uncomment if needed)
|
|
# echo "Pushing image to registry..."
|
|
# docker push "$IMAGE"
|
|
# echo "Image pushed successfully!"
|
|
|
|
echo "To push the image, run:"
|
|
echo "docker push $IMAGE" |