-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·30 lines (25 loc) · 865 Bytes
/
build.sh
File metadata and controls
executable file
·30 lines (25 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
set -e
# Define colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
# Check if Podman is installed
if ! command -v podman &> /dev/null; then
echo -e "${RED}Error: Podman is not installed. Please install it to continue.${NC}" >&2
exit 1
fi
# Start Podman machine if not running
if ! podman machine list --format "{{.Running}}" | grep -q "true"; then
echo -e "${YELLOW}Starting Podman machine...${NC}"
podman machine start
fi
# Build the container image
echo -e "${YELLOW}Building container image with Podman...${NC}"
podman manifest create "localhost/cloud-tools-container"
podman build . \
--manifest "localhost/cloud-tools-container" \
--platform "linux/amd64,linux/arm64" \
--tag "localhost/cloud-tools-container:latest"
echo -e "${GREEN}Build script completed successfully.${NC}"