-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FAB-5412 add fabric-preload.sh script
Add a script to allow users to preload the Fabric docker images without having to run the curl command in the RTD. Change-Id: I3b6c682c3e2ab1f230f7af8c3ce0b95bbb8fd024 Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
- Loading branch information
1 parent
a7e83fc
commit 134549a
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
## Hyperledger Fabric Samples | ||
|
||
fabric-preload.sh will preload all of the requisite docker images for Hyperledger Fabric and tag them | ||
with the 'latest' tag. Optionally, specify a specific version (e.g. 1.0.1). Default version is 1.0.0. | ||
|
||
```bash | ||
./fabric-preload.sh [version] | ||
``` | ||
|
||
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright IBM Corp. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
export VERSION=${1:-1.0.0} | ||
export ARCH=$(echo "$(uname -s|tr '[:upper:]' '[:lower:]'|sed 's/mingw64_nt.*/windows/')-$(uname -m | sed 's/x86_64/amd64/g')" | awk '{print tolower($0)}') | ||
#Set MARCH variable i.e ppc64le,s390x,x86_64,i386 | ||
MARCH=`uname -m` | ||
|
||
dockerFabricPull() { | ||
local FABRIC_TAG=$1 | ||
for IMAGES in peer orderer couchdb ccenv javaenv kafka zookeeper tools; do | ||
echo "==> FABRIC IMAGE: $IMAGES" | ||
echo | ||
docker pull hyperledger/fabric-$IMAGES:$FABRIC_TAG | ||
docker tag hyperledger/fabric-$IMAGES:$FABRIC_TAG hyperledger/fabric-$IMAGES | ||
done | ||
} | ||
|
||
dockerCaPull() { | ||
local CA_TAG=$1 | ||
echo "==> FABRIC CA IMAGE" | ||
echo | ||
docker pull hyperledger/fabric-ca:$CA_TAG | ||
docker tag hyperledger/fabric-ca:$CA_TAG hyperledger/fabric-ca | ||
} | ||
|
||
: ${CA_TAG:="$MARCH-$VERSION"} | ||
: ${FABRIC_TAG:="$MARCH-$VERSION"} | ||
|
||
echo "===> Pulling fabric Images" | ||
dockerFabricPull ${FABRIC_TAG} | ||
|
||
echo "===> Pulling fabric ca Image" | ||
dockerCaPull ${CA_TAG} | ||
echo | ||
echo "===> List out hyperledger docker images" | ||
docker images | grep hyperledger* | ||
|