2017-11-02 10:19:05 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-02-08 21:23:37 +08:00
|
|
|
# Define those global variables
|
|
|
|
if [ -f ./variables.sh ]; then
|
|
|
|
source ./variables.sh
|
|
|
|
elif [ -f scripts/variables.sh ]; then
|
|
|
|
source scripts/variables.sh
|
|
|
|
else
|
|
|
|
echo_r "Cannot find the variables.sh files, pls check"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
pull_image() {
|
|
|
|
IMG=$1
|
|
|
|
if [ -z "$(docker images -q ${IMG} 2> /dev/null)" ]; then # not exist
|
|
|
|
docker pull ${IMG}
|
|
|
|
else
|
|
|
|
echo "${IMG} already exist locally"
|
|
|
|
fi
|
|
|
|
}
|
2017-11-02 10:19:05 +08:00
|
|
|
|
2018-01-23 17:53:52 +08:00
|
|
|
echo "Downloading images from DockerHub... need a while"
|
2017-11-02 10:19:05 +08:00
|
|
|
|
|
|
|
# TODO: we may need some checking on pulling result?
|
2018-01-30 16:29:57 +08:00
|
|
|
echo "===Pulling fabric images from yeasy repo... with tag = ${FABRIC_IMG_TAG}"
|
2018-02-08 21:23:37 +08:00
|
|
|
for IMG in base peer orderer ca; do
|
|
|
|
HLF_IMG=yeasy/hyperledger-fabric-${IMG}:$FABRIC_IMG_TAG
|
|
|
|
pull_image $HLF_IMG
|
|
|
|
done
|
2018-02-27 12:51:06 +08:00
|
|
|
pull_image yeasy/hyperledger-fabric:$FABRIC_IMG_TAG
|
|
|
|
pull_image yeasy/blockchain-explorer:0.1.0-preview # TODO: wait for official images
|
2018-02-08 21:23:37 +08:00
|
|
|
|
|
|
|
|
2018-02-27 12:51:06 +08:00
|
|
|
echo "===Pulling base images from official repo... with tag = ${BASE_IMG_TAG}"
|
|
|
|
for IMG in baseimage baseos; do
|
2018-02-08 21:23:37 +08:00
|
|
|
HLF_IMG=hyperledger/fabric-${IMG}:$ARCH-$BASE_IMG_TAG
|
|
|
|
pull_image $HLF_IMG
|
|
|
|
done
|
2017-11-02 10:19:05 +08:00
|
|
|
|
|
|
|
# Only useful for debugging
|
|
|
|
# docker pull yeasy/hyperledger-fabric
|
|
|
|
|
2018-01-30 16:29:57 +08:00
|
|
|
echo "===Pulling fabric images from official repo... with tag = ${FABRIC_IMG_TAG}"
|
2018-02-27 12:51:06 +08:00
|
|
|
for IMG in peer tools orderer ca ccenv couchdb kafka zookeeper; do
|
|
|
|
HLF_IMG=hyperledger/fabric-${IMG}:$ARCH-$FABRIC_IMG_TAG
|
2018-02-08 21:23:37 +08:00
|
|
|
pull_image $HLF_IMG
|
|
|
|
done
|
2017-11-02 10:19:05 +08:00
|
|
|
|
2018-02-27 12:51:06 +08:00
|
|
|
pull_image mysql:8.0
|
|
|
|
|
2018-02-08 21:23:37 +08:00
|
|
|
echo "Image pulling done, now can startup the network using docker-compose..."
|
2017-11-02 10:19:05 +08:00
|
|
|
|
2018-02-08 21:23:37 +08:00
|
|
|
exit 0
|