diff --git a/Makefile b/Makefile index 90ede1424..7c482c573 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,8 @@ # - doc: Start a local web service to explore the documentation # - docker[-clean]: Build/clean docker images locally # - dockerhub: Build using dockerhub materials, to verify them -# - license: Checks sourrce files for Apache license header +# - dockerhub-pull: Pulling service images from dockerhub +# - license: Checks sourrce files for Apache license header # - help: Output the help instructions for each command # - log: Check the recent log output of all services # - restart: Stop the cello service and then start @@ -140,6 +141,9 @@ dockerhub-%: ##@Building latest images with dockerhub materials, to valid them -t $$IMG:x86_64-latest \ dockerhub/latest/$$dir +dockerhub-pull: ##@Pull service images from dockerhub + cd scripts/master_node && bash download_images.sh + license: bash scripts/check_license.sh diff --git a/docs/setup_master.md b/docs/setup_master.md index ecb79f564..59a9135a4 100644 --- a/docs/setup_master.md +++ b/docs/setup_master.md @@ -101,7 +101,7 @@ Cello project also provide Docker images for quick adoptions, users can pull the ### Pull from Dockerhub The build process is generally expensive so you may wanna just pull those images from Dockerhub. -Run `cd scripts/master_node && bash download_images.sh` will pull the following images: +Run `make dockerhub-pull` will pull the following images: * [hyperledger/cello-baseimage](https://hub.docker.com/r/hyperledger/cello-baseimage/): Base images for the service images. * [hyperledger/cello-engine](https://hub.docker.com/r/hyperledger/cello-engine/): Docker images for the engine service. @@ -113,8 +113,7 @@ Run `cd scripts/master_node && bash download_images.sh` will pull the following By default, the `latest` version of images will be pulled, and you may optionally specify the version of images to pull down: ``` -$ cd scripts/master_node -$ VERSION=0.8.0-beta bash download_images.sh +$ VERSION=0.8.0-beta make dockerhub-pull ``` ### Local Building diff --git a/scripts/master_node/download_images.sh b/scripts/master_node/download_images.sh index f9f8c1e14..ea25cfbe6 100644 --- a/scripts/master_node/download_images.sh +++ b/scripts/master_node/download_images.sh @@ -36,13 +36,13 @@ echo_b "Check node:9.2 image." for IMG in baseimage engine mongo nginx operator-dashboard user-dashboard watchdog ; do HLC_IMG=hyperledger/cello-${IMG} - if [ -z "$(docker images -q ${HLC_IMG}:${ARCH}-${VERSION} 2> /dev/null)" ]; then # not exist - echo_b "Pulling ${HLC_IMG}:${ARCH}-${VERSION} from dockerhub" - docker pull ${HLC_IMG}:${ARCH}-${VERSION} - docker tag ${HLC_IMG}:${ARCH}-${VERSION} ${HLC_IMG} # match the docker-compose file - else - echo_g "${HLC_IMG} already exist locally" - fi + #if [ -z "$(docker images -q ${HLC_IMG}:${ARCH}-${VERSION} 2> /dev/null)" ]; then # not exist + echo_b "Pulling ${HLC_IMG}:${ARCH}-${VERSION} from dockerhub" + docker pull ${HLC_IMG}:${ARCH}-${VERSION} + docker tag ${HLC_IMG}:${ARCH}-${VERSION} ${HLC_IMG} # match the docker-compose file + #else + # echo_g "${HLC_IMG} already exist locally" + #fi done echo_g "All Image downloaded "