-
Notifications
You must be signed in to change notification settings - Fork 949
/
build_docker_image.sh
executable file
·63 lines (53 loc) · 2.01 KB
/
build_docker_image.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
#!/bin/bash
#SPDX-License-Identifier: Apache-2.0
FABRIC_EXPLORER_DB_TAG="hyperledger/explorer-db"
FABRIC_EXPLORER_TAG="hyperledger/explorer"
function banner(){
echo ""
echo " _ _ _ _ ______ _ "
echo " | | | | | | | | | ____| | | "
echo " | |__| |_ _ _ __ ___ _ __| | ___ __| | __ _ ___ _ __ | |__ __ ___ __ | | ___ _ __ ___ _ __ "
echo " | __ | | | | '_ \ / _ \ '__| |/ _ \/ _\` |/ _\` |/ _ \ '__| | __| \ \/ / '_ \| |/ _ \| '__/ _ \ '__|"
echo " | | | | |_| | |_) | __/ | | | __/ (_| | (_| | __/ | | |____ > <| |_) | | (_) | | | __/ | "
echo " |_| |_|\__, | .__/ \___|_| |_|\___|\__,_|\__, |\___|_| |______/_/\_\ .__/|_|\___/|_| \___|_| "
echo " __/ | | __/ | | | "
echo " |___/|_| |___/ |_| "
echo ""
}
function deploy_build_database(){
echo "Building Hyperledger Fabric Database image..."
docker build --build-arg "http_proxy=${http_proxy}" --build-arg "https_proxy=${https_proxy}" --build-arg "no_proxy=${no_proxy}" -f postgres-Dockerfile --tag $FABRIC_EXPLORER_DB_TAG .
}
function deploy_build_explorer(){
echo "Building Hyperledger Fabric explorer image..."
docker build --build-arg "http_proxy=${http_proxy}" --build-arg "https_proxy=${https_proxy}" --build-arg "no_proxy=${no_proxy}" --tag $FABRIC_EXPLORER_TAG .
}
banner
build_db=0
build_explorer=0
build_all=1
while getopts "de" opt; do
case "$opt" in
d)
echo "Build DB images"
build_db=1
build_all=0
;;
e)
echo "Build Explorer images"
build_explorer=1
build_all=0
;;
esac
done
if [ $build_all -eq 1 ]; then
deploy_build_explorer
deploy_build_database
else
if [ $build_db -eq 1 ]; then
deploy_build_database
fi
if [ $build_explorer -eq 1 ]; then
deploy_build_explorer
fi
fi