Skip to content

Commit

Permalink
[CE-198] Enable Docker Compose v3 support
Browse files Browse the repository at this point in the history
Compose v3 support more powerful features like image tag from env.

This enable us manupulate the docker images more flexibly.

Change-Id: I6e0717ee9cd164e0437117365d0fa1ef9383e223
Signed-off-by: Baohua Yang <yangbaohua@gmail.com>
  • Loading branch information
yeasy committed Dec 14, 2017
1 parent 1b9f8ba commit af6dc14
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 271 deletions.
23 changes: 0 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,6 @@ pip-selfcheck.json

# All .idea stuff:
.idea/*
.idea/

# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/libraries

# Mongo Explorer plugin:
.idea/mongoSettings.xml

## File-based project format:
*.iws
Expand Down
20 changes: 17 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# nginx: front end
# mongo: mongo db

version: '2'
version: '3.2'
services:
# cello dashboard service
dashboard:
Expand Down Expand Up @@ -75,7 +75,14 @@ services:
hostname: mongo
container_name: mongo
restart: unless-stopped
mem_limit: 2048m
deploy:
resources:
limits:
cpus: '0.50'
memory: 2048M
reservations:
cpus: '0.10'
memory: 256M
ports:
#- "27017:27017" # use follow line instead in production env
- "127.0.0.1:27017:27017"
Expand All @@ -91,7 +98,14 @@ services:
hostname: nginx
container_name: nginx
restart: always
mem_limit: 2048m
deploy:
resources:
limits:
cpus: '0.50'
memory: 2048M
reservations:
cpus: '0.10'
memory: 256M
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.default.conf
#- /opt/cello/nginx/log/:/var/log/nginx/
Expand Down
2 changes: 1 addition & 1 deletion scripts/master_node/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ echo_b "Add existing user to docker group"
sudo usermod -aG docker ${USER}

echo_b "Checking to install Docker-compose..."
command -v docker-compose >/dev/null 2>&1 || { echo_r >&2 "No docker-compose found, try installing"; sudo pip install docker-compose; }
command -v docker-compose >/dev/null 2>&1 || { echo_r >&2 "No docker-compose found, try installing"; sudo pip install 'docker-compose>=1.17.0'; }

[ `sudo docker ps -qa|wc -l` -gt 0 ] \
&& echo_r "Warn: existing containers may cause unpredictable failure, suggest to clean them using docker rm"
Expand Down
11 changes: 6 additions & 5 deletions scripts/worker_node/download_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ BASEIMAGE_RELEASE=0.3.2
BASE_VERSION=1.0.5
PROJECT_VERSION=1.0.5
IMG_TAG=1.0.5
HLF_VERSION=1.0.5 # TODO: should be the same with src/common/utils.py

echo_b "Downloading fabric images from DockerHub...with tag = ${IMG_TAG}... need a while"
# TODO: we may need some checking on pulling result?
Expand All @@ -32,10 +33,10 @@ docker pull hyperledger/fabric-baseos:$ARCH-$BASEIMAGE_RELEASE
# Only useful for debugging
# docker pull yeasy/hyperledger-fabric

echo_b "===Re-tagging images to *latest* tag"
docker tag hyperledger/fabric-peer:$ARCH-$IMG_TAG hyperledger/fabric-peer
docker tag hyperledger/fabric-tools:$ARCH-$IMG_TAG hyperledger/fabric-tools
docker tag hyperledger/fabric-orderer:$ARCH-$IMG_TAG hyperledger/fabric-orderer
docker tag hyperledger/fabric-ca:$ARCH-$IMG_TAG hyperledger/fabric-ca
echo_b "===Re-tagging images to *:${HLF_VERSION}* tag"
docker tag hyperledger/fabric-peer:$ARCH-$IMG_TAG hyperledger/fabric-peer:${HLF_VERSION}
docker tag hyperledger/fabric-tools:$ARCH-$IMG_TAG hyperledger/fabric-tools:${HLF_VERSION}
docker tag hyperledger/fabric-orderer:$ARCH-$IMG_TAG hyperledger/fabric-orderer:${HLF_VERSION}
docker tag hyperledger/fabric-ca:$ARCH-$IMG_TAG hyperledger/fabric-ca:${HLF_VERSION}

echo_g "Done, now worker node should have all images, use `docker images` to check"

This file was deleted.

Loading

0 comments on commit af6dc14

Please sign in to comment.