docker-compose-files/hyperledger_fabric/latest/scripts/download_images.sh

64 lines
2.4 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2019-04-01 11:10:38 +08:00
# peer/orderer/ca/ccenv/tools/javaenv/baseos: 1.4, 1.4.0, 1.4.1, 2.0.0, latest
# baseimage (runtime for golang chaincode)/couchdb: 0.4.15, latest
# Noted:
# * the fabric-baseos 1.4/2.0 tags are not available at dockerhub yet, only latest/0.4.15 now
# * the fabric-nodeenv is not available at dockerhub yet
# In core.yaml, it requires:
# * fabric-ccenv:$(PROJECT_VERSION)
# * fabric-baseos:$(PROJECT_VERSION)
# * fabric-javaenv:latest
# * fabric-nodeenv:latest
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
2018-03-05 13:53:21 +08:00
#if [ -z "$(docker images -q ${IMG} 2> /dev/null)" ]; then # not exist
# docker pull ${IMG}
#else
# echo "${IMG} already exist locally"
#fi
docker pull ${IMG}
2018-02-08 21:23:37 +08:00
}
2018-01-30 15:54:49 +08:00
echo "Downloading images from DockerHub... need a while"
# TODO: we may need some checking on pulling result?
2019-04-01 11:10:38 +08:00
echo "=== Pulling yeasy/hyperledger-fabric-* images with tag ${FABRIC_IMG_TAG}... ==="
2018-02-08 21:23:37 +08:00
for IMG in base peer orderer ca; do
2019-04-01 11:10:38 +08:00
pull_image yeasy/hyperledger-fabric-${IMG}:$FABRIC_IMG_TAG
2018-02-08 21:23:37 +08:00
done
2018-03-05 13:53:21 +08:00
pull_image yeasy/hyperledger-fabric:$FABRIC_IMG_TAG
2019-04-01 11:10:38 +08:00
# pull_image yeasy/blockchain-explorer:0.1.0-preview # TODO: wait for official images
echo "=== Pulling fabric core images ${FABRIC_IMG_TAG} from fabric repo... ==="
for IMG in peer orderer ca ccenv tools baseos javaenv nodeenv; do
pull_image hyperledger/fabric-${IMG}:$FABRIC_IMG_TAG
2018-02-08 21:23:37 +08:00
done
2019-04-01 16:21:22 +08:00
# core.yaml requires a PROJECT_VERSION tag, only need when testing latest code
docker tag hyperledger/fabric-ccenv:$FABRIC_IMG_TAG hyperledger/fabric-ccenv:${PROJECT_VERSION}
pull_image hyperledger/fabric-javaenv:latest # core.yaml requires a latest tag
2019-04-01 11:10:38 +08:00
# core.yaml requires a latest tag, but nodeenv is not available in docker hub yet
# pull_image hyperledger/fabric-nodeenv:latest
pull_image hyperledger/fabric-baseos:latest # fabric-baseos does not have 1.4/2.0 tag yet, but core.yaml requires a PROJECT_VERSION tag
docker tag hyperledger/fabric-baseos:latest hyperledger/fabric-baseos:${PROJECT_VERSION}
echo "=== Pulling base/3rd-party images with tag ${BASE_IMG_TAG} from fabric repo... ==="
for IMG in baseimage couchdb kafka zookeeper; do
pull_image hyperledger/fabric-${IMG}:$BASE_IMG_TAG
2018-02-08 21:23:37 +08:00
done
2018-03-05 13:53:21 +08:00
2019-04-01 11:10:38 +08:00
echo "Image pulling done, now can startup the network using make start..."
2018-03-05 13:53:21 +08:00
exit 0