forked from MinaProtocol/mina
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3-builder
More file actions
75 lines (65 loc) · 3.53 KB
/
Copy path3-builder
File metadata and controls
75 lines (65 loc) · 3.53 KB
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
#################################################################################################
# The "builder" Stage
# - builds mina and any other binaries required to run rosetta
# - should not include any data related to joining a specific network, only the node software itself
#################################################################################################
FROM opam-deps AS builder
# Use --build-arg "DUNE_PROFILE=dev" to build a dev image or for CI
ARG DUNE_PROFILE=devnet
# branch to checkout on first clone (this will be the only available branch in the container)
# can also be a tagged release
ARG MINA_BRANCH=compatible
# repo to checkout the branch from
ARG MINA_REPO=https://github.com/MinaProtocol/mina
# location of repo used for pins and external package commits
ARG MINA_DIR=mina
ENV PATH "$PATH:/usr/lib/go/bin:$HOME/.cargo/bin"
# --- Shallow Clone the Mina repo
# Delete any previous clones of the mina repo and then clone into an empty directory
RUN cd $HOME && rm -rf $HOME/${MINA_DIR} \
&& git clone \
-b "${MINA_BRANCH}" \
--depth 1 \
--shallow-submodules \
--recurse-submodules \
${MINA_REPO} ${HOME}/${MINA_DIR}
# Set the working directory to the cloned mina repo
WORKDIR $HOME/${MINA_DIR}
# Create a directory for compiled outputs
RUN mkdir ${HOME}/app
# --- Build libp2p_helper
RUN make libp2p_helper \
&& mv src/app/libp2p_helper/result/bin/libp2p_helper ${HOME}/app/libp2p_helper
# HACK: build without special cpu features to allow more people to run mina-rosetta
RUN ./scripts/zexe-standardize.sh
# --- Make rosetta-crucial components and the generate_keypair tool
RUN eval $(opam config env) \
&& dune build --profile=${DUNE_PROFILE} \
src/app/cli/src/mina_testnet_signatures.exe \
src/app/cli/src/mina_mainnet_signatures.exe \
src/app/archive/archive.exe \
src/app/archive_blocks/archive_blocks.exe \
src/app/extract_blocks/extract_blocks.exe \
src/app/missing_blocks_auditor/missing_blocks_auditor.exe \
src/app/replayer/replayer.exe \
src/app/rosetta/rosetta_testnet_signatures.exe \
src/app/rosetta/rosetta_mainnet_signatures.exe \
src/app/generate_keypair/generate_keypair.exe \
src/app/validate_keypair/validate_keypair.exe \
src/app/rosetta/ocaml-signer/signer.exe \
&& cp _build/default/src/app/archive_blocks/archive_blocks.exe $HOME/app/mina-archive-blocks \
&& cp _build/default/src/app/extract_blocks/extract_blocks.exe $HOME/app/mina-extract-blocks \
&& cp _build/default/src/app/missing_blocks_auditor/missing_blocks_auditor.exe $HOME/app/mina-missing-blocks-auditor \
&& cp _build/default/src/app/replayer/replayer.exe $HOME/app/mina-replayer \
&& mv _build/default/src/app/cli/src/mina_mainnet_signatures.exe $HOME/app/mina \
&& mv _build/default/src/app/cli/src/mina_testnet_signatures.exe $HOME/app/mina-dev \
&& mv _build/default/src/app/archive/archive.exe $HOME/app/mina-archive \
&& mv _build/default/src/app/rosetta/rosetta_mainnet_signatures.exe $HOME/app/mina-rosetta \
&& mv _build/default/src/app/rosetta/rosetta_testnet_signatures.exe $HOME/app/mina-rosetta-dev \
&& mv _build/default/src/app/generate_keypair/generate_keypair.exe $HOME/app/mina-generate-keypair \
&& mv _build/default/src/app/validate_keypair/validate_keypair.exe $HOME/app/mina-validate-keypair \
&& mv _build/default/src/app/rosetta/ocaml-signer/signer.exe $HOME/app/mina-ocaml-signer \
&& rm -rf _build
# --- Clear go module caches to make the container smaller
RUN cd src/app/libp2p_helper/src/libp2p_helper \
&& go clean --cache --modcache --testcache -r