Skip to content

Commit

Permalink
Merge pull request hyperledger-archives#2083 from s390xlinux/master
Browse files Browse the repository at this point in the history
Only pull baseimage if a local one doesn't exist
  • Loading branch information
ghaskins authored Jul 14, 2016
2 parents b2689b9 + 8197fab commit 3242eb3
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions scripts/provision/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,26 @@ DOCKERHUB_NAME=$NAME:$RELEASE

CURDIR=`dirname $0`

echo "BUILD-CACHE: Pulling \"$DOCKERHUB_NAME\" from dockerhub.."
docker pull $DOCKERHUB_NAME
docker inspect $DOCKERHUB_NAME 2>&1 > /dev/null
if [ "$?" == "0" ]; then
echo "BUILD-CACHE: Success!"
echo "BUILD-CACHE: exists!"
BASENAME=$DOCKERHUB_NAME
else
echo "BUILD-CACHE: WARNING - Build-cache unavailable, attempting local build"
(cd $CURDIR/../../images/base && make docker DOCKER_TAG=localbuild)
if [ "$?" != "0" ]; then
echo "ERROR: Build-cache could not be compiled locally"
exit -1
echo "BUILD-CACHE: Pulling \"$DOCKERHUB_NAME\" from dockerhub.."
docker pull $DOCKERHUB_NAME
docker inspect $DOCKERHUB_NAME 2>&1 > /dev/null
if [ "$?" == "0" ]; then
echo "BUILD-CACHE: Success!"
BASENAME=$DOCKERHUB_NAME
else
echo "BUILD-CACHE: WARNING - Build-cache unavailable, attempting local build"
(cd $CURDIR/../../images/base && make docker DOCKER_TAG=localbuild)
if [ "$?" != "0" ]; then
echo "ERROR: Build-cache could not be compiled locally"
exit -1
fi
BASENAME=$NAME:localbuild
fi
BASENAME=$NAME:localbuild
fi

# Ensure that we have the baseimage we are expecting
Expand Down

0 comments on commit 3242eb3

Please sign in to comment.