forked from dionysio/spendee
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·41 lines (33 loc) · 760 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·41 lines (33 loc) · 760 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
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -euo pipefail
IMAGE_NAME="spendee-mcp"
REGISTRY="127.0.0.1:5555"
TAG="latest"
NO_PUSH=0
while [[ $# -gt 0 ]]; do
case "$1" in
-t)
TAG="$2"
shift 2
;;
--no-push)
NO_PUSH=1
shift
;;
*)
echo "Usage: $0 [-t tag] [--no-push]"
exit 1
;;
esac
done
REGISTRY_TAG="$REGISTRY/$IMAGE_NAME:$TAG"
cd "$(dirname "$0")"
echo "Building Docker image..."
docker build -t "$IMAGE_NAME:$TAG" -t "$REGISTRY_TAG" .
if [[ "$NO_PUSH" -eq 0 ]]; then
echo "Pushing Docker image to local registry..."
docker push "$REGISTRY_TAG"
else
echo "Skipping push to local registry (--no-push specified)."
fi
echo "Done."