forked from openhive-network/hive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
117 lines (89 loc) · 4.07 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#Usage: DOCKER_BUILDKIT=1 docker build --no-cache --target=testnet_node_builder .
ARG BUILD_HIVE_TESTNET=OFF
ARG HIVE_LINT=OFF
FROM registry.gitlab.syncad.com/hive/hive/hive-baseenv:latest AS builder
ENV src_dir="/usr/local/src/hive"
ENV install_base_dir="/usr/local/hive"
ENV LANG=en_US.UTF-8
ADD . ${src_dir}
WORKDIR ${src_dir}
###################################################################################################
## CONSENSUS NODE BUILD ##
###################################################################################################
FROM builder AS consensus_node_builder
RUN \
cd ${src_dir} && \
${src_dir}/ciscripts/build.sh "OFF" "ON"
###################################################################################################
## CONSENSUS NODE CONFIGURATION ##
###################################################################################################
FROM builder AS consensus_node
ARG TRACKED_ACCOUNT_NAME
ENV TRACKED_ACCOUNT_NAME=${TRACKED_ACCOUNT_NAME}
ARG USE_PUBLIC_BLOCKLOG
ENV USE_PUBLIC_BLOCKLOG=${USE_PUBLIC_BLOCKLOG}
WORKDIR "${install_base_dir}/consensus"
# Get all needed files from previous stage, and throw away unneeded rest(like objects)
COPY --from=consensus_node_builder ${src_dir}/build/install-root/ ${src_dir}/contrib/hived.run ./
COPY --from=consensus_node_builder ${src_dir}/contrib/config-for-docker.ini datadir/config.ini
RUN \
ls -la && \
chmod +x hived.run
# rpc service :
EXPOSE 8090
# p2p service :
EXPOSE 2001
CMD "${install_base_dir}/consensus/hived.run"
###################################################################################################
## GENERAL NODE BUILD ##
###################################################################################################
FROM builder AS general_node_builder
ARG BUILD_HIVE_TESTNET
ARG HIVE_LINT
ENV BUILD_HIVE_TESTNET=${BUILD_HIVE_TESTNET}
ENV HIVE_LINT=${HIVE_LINT}
RUN \
cd ${src_dir} && \
${src_dir}/ciscripts/build.sh ${BUILD_HIVE_TESTNET} ${HIVE_LINT}
###################################################################################################
## GENERAL NODE CONFIGURATION ##
###################################################################################################
FROM builder AS general_node
ARG TRACKED_ACCOUNT_NAME
ENV TRACKED_ACCOUNT_NAME=${TRACKED_ACCOUNT_NAME}
ARG USE_PUBLIC_BLOCKLOG
ENV USE_PUBLIC_BLOCKLOG=${USE_PUBLIC_BLOCKLOG}
WORKDIR "${install_base_dir}/hive-node"
# Get all needed files from previous stage, and throw away unneeded rest(like objects)
COPY --from=general_node_builder ${src_dir}/build/install-root/ ${src_dir}/contrib/hived.run ./
COPY --from=general_node_builder ${src_dir}/contrib/config-for-docker.ini datadir/config.ini
RUN \
ls -la && \
chmod +x hived.run
# rpc service :
EXPOSE 8090
# p2p service :
EXPOSE 2001
CMD "${install_base_dir}/hive-node/hived.run"
###################################################################################################
## TESTNET NODE BUILD ##
###################################################################################################
FROM builder AS testnet_node_builder
ARG HIVE_LINT=ON
ENV BUILD_HIVE_TESTNET="ON"
ENV HIVE_LINT=${HIVE_LINT}
RUN \
cd ${src_dir} && \
apt-get update && \
apt-get install -y clang && \
apt-get install -y clang-tidy && \
${src_dir}/ciscripts/build.sh ${BUILD_HIVE_TESTNET} ${HIVE_LINT} && \
apt-get install -y screen && \
pip3 install -U secp256k1prp && \
git clone https://gitlab.syncad.com/hive/beem.git && \
cd beem && \
git checkout dk-update-proposal-operation && \
python3 setup.py build && \
python3 setup.py install --user && \
cd ${src_dir} && \
${src_dir}/ciscripts/run_regressions.sh