-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathupload.sh
executable file
·64 lines (55 loc) · 2.06 KB
/
upload.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
echo "** Build and Push TinyLLM chatbot and docman to Docker Hub"
# Get version
string=`grep "VERSION =" version.py`
VER=$(echo $string | awk '{print $NF}' | sed 's/v//' | sed 's/"//g')
echo "** Version: $VER"
echo ""
# Ask for which container to build
echo "Which container do you want to build?"
echo "1. jasonacox/chatbot"
echo "2. jasonacox/docman"
echo "3. both"
echo ""
read -p "Enter selection: " container
echo ""
# If the user selects 1 jasonacox/chatbot or 3
if [ $container -eq 1 ] || [ $container -eq 3 ]; then
echo "Build and Push jasonacox/chatbot to Docker Hub"
echo ""
# Build jasonacox/chatbot:x.y.z
echo "* BUILD jasonacox/chatbot:${VER}"
docker buildx build --no-cache --platform linux/amd64,linux/arm64 --push -t jasonacox/chatbot:${VER} .
echo ""
# Build jasonacox/chatbot:latest
echo "* BUILD jasonacox/chatbot:latest"
docker buildx build --platform linux/amd64,linux/arm64 --push -t jasonacox/chatbot:latest .
echo ""
# Verify
echo "* VERIFY jasonacox/chatbot:${VER}"
docker buildx imagetools inspect jasonacox/chatbot:${VER} | grep Platform
echo ""
echo "* VERIFY jasonacox/chatbot:latest"
docker buildx imagetools inspect jasonacox/chatbot | grep Platform
echo ""
fi
if [ $container -eq 2 ] || [ $container -eq 3 ]; then
echo "Build and Push jasonacox/docman to Docker Hub"
echo ""
# Build jasonacox/docman:x.y.z
echo "* BUILD jasonacox/docman:${VER}"
docker buildx build --no-cache --platform linux/amd64,linux/arm64 --push -t jasonacox/docman:${VER} -f Dockerfile-docman .
echo ""
# Build jasonacox/docman:latest
echo "* BUILD jasonacox/docman:latest"
docker buildx build --platform linux/amd64,linux/arm64 --push -t jasonacox/docman:latest -f Dockerfile-docman .
echo ""
# Verify
echo "* VERIFY jasonacox/docman:${VER}"
docker buildx imagetools inspect jasonacox/docman:${VER} | grep Platform
echo ""
echo "* VERIFY jasonacox/docman:latest"
docker buildx imagetools inspect jasonacox/docman | grep Platform
echo ""
fi
# End