Spaces:
Sleeping
Sleeping
| IMAGE_NAME="radar-quality-calculator" | |
| function docker_build { | |
| # Image name | |
| # Check if Docker is installed | |
| if ! command -v docker &>/dev/null; then | |
| echo "Docker could not be found. Please install Docker to proceed." | |
| return | |
| fi | |
| # Check if Docker daemon is running | |
| if ! docker info &>/dev/null; then | |
| echo "Docker daemon is not running. Please start Docker to proceed." | |
| return | |
| fi | |
| # Check if Dockerfile exists | |
| if [ ! -f Dockerfile ]; then | |
| echo "Dockerfile not found in the current directory. Please ensure you are in the correct directory." | |
| return | |
| fi | |
| # Remove existing image if it exists | |
| echo "Removing existing image if it exists..." | |
| docker rmi -f $IMAGE_NAME 2>/dev/null || true | |
| # Build new image | |
| echo "Building new image..." | |
| docker build -t $IMAGE_NAME . | |
| echo "Build complete!" | |
| } | |
| docker_build | |