Skip to content

Commit

Permalink
add docker build infrastructure
Browse files Browse the repository at this point in the history
quick start:

    docker-compose up

Signed-off-by: Simon Schubert <[email protected]>
  • Loading branch information
corecode committed Dec 22, 2015
1 parent 56491bc commit 131c723
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
obc-peer
.git
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from golang:1.5.1
ENV GO15VENDOREXPERIMENT=1
# Install RocksDB
RUN cd /opt && git clone --branch v4.1 --single-branch --depth 1 https://github.com/facebook/rocksdb.git && cd rocksdb && make shared_lib
ENV LD_LIBRARY_PATH=/opt/rocksdb:$LD_LIBRARY_PATH
RUN apt-get update && apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev
# Copy GOPATH src and install Peer
RUN mkdir -p /var/openchain/db
WORKDIR $GOPATH/src/github.com/openblockchain/obc-peer/
COPY . .
RUN CGO_CFLAGS="-I/opt/rocksdb/include" CGO_LDFLAGS="-L/opt/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install
# RUN cd obc-ca && go install
5 changes: 5 additions & 0 deletions compose-defaults.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vp:
build: .
environment:
- OPENCHAIN_PEER_ADDRESSAUTODETECT=true
command: obc-peer peer
36 changes: 36 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
vp1:
extends:
file: compose-defaults.yml
service: vp
environment:
- OPENCHAIN_PEER_ID=vp1

vp2:
extends:
file: compose-defaults.yml
service: vp
environment:
- OPENCHAIN_PEER_ID=vp2
- OPENCHAIN_PEER_DISCOVERY_ROOTNODE=vp1:30303
links:
- vp1

vp3:
extends:
file: compose-defaults.yml
service: vp
environment:
- OPENCHAIN_PEER_ID=vp3
- OPENCHAIN_PEER_DISCOVERY_ROOTNODE=vp1:30303
links:
- vp1

vp4:
extends:
file: compose-defaults.yml
service: vp
environment:
- OPENCHAIN_PEER_ID=vp4
- OPENCHAIN_PEER_DISCOVERY_ROOTNODE=vp1:30303
links:
- vp1

0 comments on commit 131c723

Please sign in to comment.