-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
49 lines (39 loc) · 2.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Dockerfile for Hyperledger fabric base image, with everything (peer, membersrvc) to go!
# If you need a peer node to run, please see the yeasy/hyperledger-peer image.
# Workdir is set to $GOPATH/src/github.com/hyperledger/fabric
# Data is stored under /var/hyperledger/db and /var/hyperledger/production
# Currently, the binary will look for config files at corresponding path.
FROM golang:1.7
MAINTAINER Baohua Yang
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev \
&& rm -rf /var/cache/apt
# install rocksdb
RUN cd /tmp \
&& git clone --single-branch -b v4.1 --depth 1 https://github.com/facebook/rocksdb.git \
&& cd rocksdb \
&& PORTABLE=1 make shared_lib \
&& INSTALL_PATH=/usr/local make install-shared \
&& ldconfig \
&& cd / \
&& rm -rf /tmp/rocksdb
RUN mkdir -p /var/hyperledger/db \
&& mkdir -p /var/hyperledger/production
# install hyperledger peer and membersrvc
RUN mkdir -p $GOPATH/src/github.com/hyperledger \
&& cd $GOPATH/src/github.com/hyperledger \
#&& git clone --single-branch -b master --depth 1 https://github.com/hyperledger/fabric.git \
&& git clone --single-branch -b v0.6 --depth 1 http://gerrit.hyperledger.org/r/fabric \
&& cd $GOPATH/src/github.com/hyperledger/fabric/peer \
&& CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install \
&& go clean \
&& cd $GOPATH/src/github.com/hyperledger/fabric/membersrvc \
&& CGO_CFLAGS=" " CGO_LDFLAGS="-lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy" go install \
&& go clean \
&& cp $GOPATH/src/github.com/hyperledger/fabric/devenv/limits.conf /etc/security/limits.conf
# this is only a workaround for current hard-coded problem when using as fabric-baseimage.
RUN ln -s $GOPATH /opt/gopath
# this is to keep compatible
RUN PATH=$GOPATH/src/github.com/hyperledger/fabric/build/bin:$PATH
WORKDIR $GOPATH/src/github.com/hyperledger/fabric