Skip to content

Commit

Permalink
Tkyonezu/docker enhance (hyperledger-iroha#176)
Browse files Browse the repository at this point in the history
* remove duplicate entry

* use 1M instead of 1G for recv buff (hyperledger-iroha#171)

* Add comments for clone iroha.git.

* Add iroha-dev container existing check.

* Add copy-paste IROHA_HOME setting
  • Loading branch information
tkyonezu authored and Warchant committed Mar 1, 2017
1 parent e236cb2 commit d4a34ad
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ build/*
.vscode/*
.idea/*
*xcworkspace*
.vscode/*
*cmake-build-debug*
CMakeLists.txt.user
config/sumeragi.json
Expand Down
13 changes: 12 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# How to build `iroha` using docker

Clone `iroha.git` on your directory.

```
git clone --recursive https://github.com/hyperledger/iroha.git
cd iroha
```

Build depends on the environment variable `IROHA_HOME` so you need to set it:

`export IROHA_HOME=$(pwd)`

Run build script and wait for completion.
```
${IROHA_HOME}/docker/build.sh
Expand All @@ -20,7 +31,7 @@ You have two options:
2. To run iroha containers and setup configs by yourself. To do this, run bash in iroha container:
```bash
# run bash instead of default /run.sh
ID=docker run -it -d hyperledger/iroha-docker bash
ID=$(docker run -it -d hyperledger/iroha-docker bash)
# attach to container
docker exec -it $ID bash
# setup config now and then execute /run.sh
Expand Down
10 changes: 6 additions & 4 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ error(){
}

# build iroha-dev image
docker build --rm=false -t hyperledger/iroha-dev ${IROHA_HOME}/docker/dev
if [ ! $? ]; then
error "can not build iroha-dev; exit code: $?"
if ! docker images hyperledger/iroha-dev | grep -q hyperledger/iroha-dev; then
docker build --rm=false -t hyperledger/iroha-dev ${IROHA_HOME}/docker/dev
if [ ! $? ]; then
error "can not build iroha-dev; exit code: $?"
fi
fi

# run dev container to build iroha
Expand All @@ -37,4 +39,4 @@ fi
docker build --rm=false -t hyperledger/iroha-docker ${IROHA_HOME}/docker/build
if [ ! $? ]; then
error "can not build iroha; exit code: $?"
fi
fi
3 changes: 2 additions & 1 deletion docker/config-discovery/config-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ def listen(self):


def listenToClient(self, tid, client, address):
data = client.recv(2**30) # 1 MB at max
data = client.recv(2**20) # 1 MB at max
if data: # we received something
print(data)
try:
self.LOCK.acquire()
self.network[tid] = json.loads(data.decode('utf-8'))
Expand Down

0 comments on commit d4a34ad

Please sign in to comment.