Files
logo-txt/docker-build-push.sh
2026-01-11 11:54:23 -05:00

30 lines
752 B
Bash
Executable File

#!/bin/bash
set -e
# Configuration
# IMAGE_NAME="git.seth.services/seth/logo-txt"
IMAGE_NAME="ghcr.io/sethwv/logo-txt"
VERSION="${1:-latest}"
echo "Building Docker image for amd64 architecture..."
docker buildx build \
--platform linux/amd64 \
-t ${IMAGE_NAME}:${VERSION} \
-t ${IMAGE_NAME}:latest \
--load \
.
echo "Testing the image..."
docker run --rm ${IMAGE_NAME}:${VERSION} python -c "import flask; import PIL; print('Image OK')"
echo "Pushing image to Container Registry..."
docker push ${IMAGE_NAME}:${VERSION}
docker push ${IMAGE_NAME}:latest
echo "Done! Image pushed to:"
echo " ${IMAGE_NAME}:${VERSION}"
echo " ${IMAGE_NAME}:latest"
echo ""
echo "To run the container:"
echo " docker run -p 5001:5001 ${IMAGE_NAME}:latest"