Skip to content

Commit

Permalink
[CE-275] Support pulling newer images
Browse files Browse the repository at this point in the history
Support pulling newer images from dockerhub even local exist.

* Allow pulling newer images even local exist;
* Add `make dockerhub-pull` command for shortcut;
* Update documentation.

Change-Id: I84d6c46781af738a1873f851accb41d5c7662608
Signed-off-by: Baohua Yang <yangbaohua@gmail.com>
  • Loading branch information
yeasy committed Feb 13, 2018
1 parent 72b0401 commit e3726b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
5 changes: 2 additions & 3 deletions docs/setup_master.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions scripts/master_node/download_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "

0 comments on commit e3726b9

Please sign in to comment.