-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile
47 lines (43 loc) · 1.33 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
FROM ubuntu:18.04
LABEL maintainer="goquarkchain"
#prerequisite
RUN apt-get update && apt-get install -y \
vim-tiny \
curl \
git \
build-essential \
make \
g++ \
swig \
libbz2-dev \
libgflags-dev \
liblz4-dev \
libsnappy-dev \
libzstd-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# install rocksdb
WORKDIR /code
RUN git clone -b v6.1.2 --single-branch https://github.com/facebook/rocksdb.git
WORKDIR /code/rocksdb
RUN make shared_lib
RUN make install-shared
ENV CGO_CFLAGS=-I/usr/local/include
ENV CGO_LDFLAGS="-L/usr/local/lib -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy"
ENV LD_LIBRARY_PATH=/usr/local/lib
# install golang
WORKDIR /code
RUN curl -sSL https://storage.googleapis.com/golang/go1.14.1.linux-amd64.tar.gz \
| tar -v -C /usr/local -xz
ENV GOPATH $HOME/go
ENV PATH $PATH:/usr/local/go/bin
ENV GOPROXY https://goproxy.io
# install goquarkchain
WORKDIR $GOPATH/src/github.com/QuarkChain
RUN git clone https://github.com/QuarkChain/goquarkchain.git
WORKDIR $GOPATH/src/github.com/QuarkChain/goquarkchain/consensus/qkchash/native
RUN g++ -shared -o libqkchash.so -fPIC qkchash.cpp -O3 -std=gnu++17 && make
WORKDIR $GOPATH/src/github.com/QuarkChain/goquarkchain/tests/loadtest/deployer
RUN go build
WORKDIR $GOPATH/src/github.com/QuarkChain/goquarkchain/cmd/cluster
RUN go build -tags nocgo