-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
29 lines (21 loc) · 860 Bytes
/
Copy pathbuild.sh
File metadata and controls
29 lines (21 loc) · 860 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
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status
set -e
IMAGE_TAG="bustavo/tracewallet:2.2"
DOCKER_USER="bustavo"
echo " Checking Docker Hub Authentication..."
# Check if user is already logged in, otherwise prompt for password safely
if ! docker system info | grep -q "Username: $DOCKER_USER"; then
echo "Not logged in as $DOCKER_USER. Please authenticate:"
docker login -u "$DOCKER_USER"
else
echo "✅ Already authenticated as $DOCKER_USER"
fi
echo -e "\n=========================================="
echo "🏗️ Building Multi-Platform Docker Image..."
# Execute the specific amd64 build command
docker build --platform linux/amd64 -t "$IMAGE_TAG" .
echo "🚀 Pushing Image to Docker Hub..."
# Push the newly built image tag to your repository
docker push "$IMAGE_TAG"
echo "Image pushed successfully!"