-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.build_base
41 lines (33 loc) · 1.35 KB
/
Dockerfile.build_base
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
# docker.local
FROM golang:1.18-alpine3.15
RUN apk add --update --no-cache bash build-base grep git
# For RocksDB
RUN apk add --update --no-cache coreutils linux-headers perl zlib-dev bzip2-dev lz4-dev snappy-dev zstd-libs zstd-dev
# For Herumi's cryptography
RUN apk add --update --no-cache gmp gmp-dev openssl-dev
# Install RocksDB
RUN cd /tmp && \
wget -O - https://github.com/facebook/rocksdb/archive/v6.20.3.tar.gz | tar xz
RUN cd /tmp/rocksdb* && \
PORTABLE=1 make -j $(nproc) install-shared OPT=-g0 USE_RTTI=1 && \
rm -R /tmp/rocksdb* && \
apk del coreutils linux-headers perl
# Install Herumi's cryptography
RUN cd /tmp && \
wget -O - https://github.com/herumi/mcl/archive/refs/tags/v1.57.tar.gz | tar xz && \
wget -O - https://github.com/herumi/bls/archive/refs/tags/v1.22.tar.gz | tar xz && \
mv mcl* mcl && \
mv bls* bls
RUN cd /tmp && \
make -C mcl -j $(nproc) lib/libmclbn256.so install && \
cp mcl/lib/libmclbn256.so /usr/local/lib && \
make MCL_DIR=$(pwd)/mcl -C bls -j $(nproc) install && \
rm -R /tmp/mcl && \
rm -R /tmp/bls
# Build libzstd:
# FIXME: Change this after https://github.com/valyala/gozstd/issues/6 is fixed.
# RUN go mod download -x github.com/valyala/gozstd
# RUN cp -r $GOPATH/pkg/mod/github.com/valyala/gozstd* /gozstd
# WORKDIR /gozstd
# RUN chmod -R +w .
# RUN make clean libzstd.a