forked from amolabs/amoabci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (51 loc) · 1.76 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# vim: set expandtab:
#### builder image
FROM golang:1.14-alpine3.12
# tools
RUN apk add bash git make gcc g++
# libs
RUN apk add snappy snappy-dev
RUN mkdir /src
WORKDIR /src
# rocksdb
RUN wget https://github.com/facebook/rocksdb/archive/v5.18.4.tar.gz
RUN tar -xzf v5.18.4.tar.gz
RUN cp -a rocksdb-5.18.4/include/rocksdb /usr/include/
COPY contrib/rocksdb/librocksdb.so* /usr/lib/
# leveldb
RUN wget https://github.com/google/leveldb/archive/v1.20.tar.gz
RUN tar -xzf v1.20.tar.gz
RUN cp -a leveldb-1.20/include/leveldb /usr/include/
COPY contrib/leveldb/libleveldb.so* /usr/lib/
# amod
RUN mkdir -p amoabci
COPY Makefile go.mod go.sum amoabci/
COPY cmd amoabci/cmd
COPY amo amoabci/amo
COPY crypto amoabci/crypto
COPY config amoabci/config
RUN make -C amoabci build_c
#### runner image
FROM alpine:3.12
# tools & libs
RUN apk add bash snappy snappy-dev
#COPY amod /usr/bin/
COPY --from=0 /usr/lib/librocksdb.so.5.18.4 /usr/lib/
RUN ln -sf /usr/lib/librocksdb.so.5.18.4 /usr/lib/librocksdb.so.5.18
RUN ln -sf /usr/lib/librocksdb.so.5.18.4 /usr/lib/librocksdb.so.5
RUN ln -sf /usr/lib/librocksdb.so.5.18.4 /usr/lib/librocksdb.so
COPY --from=0 /usr/lib/libleveldb.so.1.20 /usr/lib/
RUN ln -sf /usr/lib/libleveldb.so.1.20 /usr/lib/libleveldb.so.1
RUN ln -sf /usr/lib/libleveldb.so.1.20 /usr/lib/libleveldb.so
COPY --from=0 /usr/lib/libgcc_s.so* /usr/lib/
COPY --from=0 /usr/lib/libstdc++.so.6.0.28 /usr/lib/
RUN ln -sf /usr/lib/libstdc++.so.6.0.28 /usr/lib/libstdc++.so.6.0
RUN ln -sf /usr/lib/libstdc++.so.6.0.28 /usr/lib/libstdc++.so.6
RUN ln -sf /usr/lib/libstdc++.so.6.0.28 /usr/lib/libstdc++.so
COPY --from=0 /src/amoabci/amod /usr/bin/
COPY DOCKER/run_node.sh DOCKER/config/* /
ENV AMOHOME /amo
VOLUME $AMOHOME
WORKDIR /
EXPOSE 26656 26657
CMD ["/bin/sh", "/run_node.sh"]