-
Notifications
You must be signed in to change notification settings - Fork 32
/
Dockerfile
54 lines (44 loc) · 1.24 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
FROM erlang:24.3.3
ENV DEBIAN_FRONTEND noninteractive
RUN apt update
RUN apt-get install -y -q \
build-essential \
bison \
flex \
git \
gzip \
autotools-dev \
automake \
libtool \
pkg-config \
cmake \
libsodium-dev \
iproute2
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup update
WORKDIR /opt/router
ARG BUILD_NET=mainnet
ENV BUILD_WITHOUT_QUIC=1
ADD rebar3 rebar3
ADD rebar.config rebar.config
ADD rebar.lock rebar.lock
ADD config/grpc_gen.config config/grpc_gen.config
RUN ./rebar3 get-deps
RUN ./rebar3 as ${BUILD_NET} compile
ADD Makefile Makefile
ADD c_src/ c_src/
ADD include/ include/
ADD src/ src/
ADD scripts/ scripts/
RUN make
ADD config/ config/
ADD priv/genesis.${BUILD_NET} priv/genesis
RUN ./rebar3 as ${BUILD_NET} release
ENV PATH=$PATH:_build/${BUILD_NET}/rel/router/bin
RUN ln -s /opt/router/_build/${BUILD_NET}/rel /opt/router/_build/default/rel
RUN ln -s /opt/router/_build/default/rel/router/bin/router /opt/router-exec
ARG ROUTER_VERSION
ENV ROUTER_VERSION=${ROUTER_VERSION:-unknown}
RUN echo ${ROUTER_VERSION} > router.version && cat router.version
CMD ["make", "run"]