docker-compose-files/hyperledger/1.0/scripts/download_images.sh

48 lines
2.0 KiB
Bash

#!/usr/bin/env bash
# Detecting whether can import the header file to render colorful cli output
if [ -f ./header.sh ]; then
source ./header.sh
elif [ -f worker_node_setup/header.sh ]; then
source scripts/header.sh
else
alias echo_r="echo"
alias echo_g="echo"
alias echo_b="echo"
fi
ARCH=x86_64
BASEIMAGE_RELEASE=0.3.1
BASE_VERSION=1.0.0
PROJECT_VERSION=1.0.0-rc1
# For testing v1.0.0-rc1 images
IMG_VERSION=v1.0.0-rc1
echo_b "Downloading images from DockerHub... need a while"
# TODO: we may need some checking on pulling result?
docker pull yeasy/hyperledger-fabric-base:$IMG_VERSION \
&& docker pull yeasy/hyperledger-fabric-peer:$IMG_VERSION \
&& docker pull yeasy/hyperledger-fabric-orderer:$IMG_VERSION \
&& docker pull yeasy/hyperledger-fabric-ca:$IMG_VERSION \
&& docker pull hyperledger/fabric-couchdb:$ARCH-1.0.0-beta \
&& docker pull hyperledger/fabric-kafka:$ARCH-$PROJECT_VERSION \
&& docker pull hyperledger/fabric-zookeeper:$ARCH-$PROJECT_VERSION
# Only useful for debugging
# docker pull yeasy/hyperledger-fabric
echo_b "Rename images with official tags..."
docker tag yeasy/hyperledger-fabric-peer:$IMG_VERSION hyperledger/fabric-peer \
&& docker tag yeasy/hyperledger-fabric-peer:$IMG_VERSION hyperledger/fabric-tools \
&& docker tag yeasy/hyperledger-fabric-orderer:$IMG_VERSION hyperledger/fabric-orderer \
&& docker tag yeasy/hyperledger-fabric-ca:$IMG_VERSION hyperledger/fabric-ca \
&& docker tag yeasy/hyperledger-fabric-base:$IMG_VERSION hyperledger/fabric-ccenv:$ARCH-$PROJECT_VERSION \
&& docker tag yeasy/hyperledger-fabric-base:$IMG_VERSION hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE \
&& docker tag yeasy/hyperledger-fabric-base:$IMG_VERSION hyperledger/fabric-baseimage:$ARCH-$BASEIMAGE_RELEASE \
&& docker tag hyperledger/fabric-zookeeper:$ARCH-$PROJECT_VERSION hyperledger/fabric-zookeeper \
&& docker tag hyperledger/fabric-kafka:$ARCH-$PROJECT_VERSION hyperledger/fabric-kafka
echo_g "Done, now can startup the network using docker-compose..."