|  | 
|  | 1 | +ARG toolchain=gcr.io/o1labs-192920/mina-toolchain:ca666b3-bullseye-berkeley | 
|  | 2 | + | 
|  | 3 | +ARG base=ubuntu:noble | 
|  | 4 | + | 
|  | 5 | +ARG profile=mainnet  | 
|  | 6 | + | 
|  | 7 | +FROM ${toolchain} AS builder | 
|  | 8 | + | 
|  | 9 | +ARG profile | 
|  | 10 | + | 
|  | 11 | +USER opam | 
|  | 12 | + | 
|  | 13 | +WORKDIR /home/opam/mina | 
|  | 14 | + | 
|  | 15 | +ARG commit=origin/compatible | 
|  | 16 | + | 
|  | 17 | +RUN git fetch origin ${commit} \ | 
|  | 18 | +  && git reset --hard ${commit} \ | 
|  | 19 | +  && git clean -fd \ | 
|  | 20 | +  && git submodule sync \ | 
|  | 21 | +  && git submodule update --init --recursive --depth 1 | 
|  | 22 | + | 
|  | 23 | +RUN ./scripts/build-portable.sh ${profile} | 
|  | 24 | + | 
|  | 25 | +FROM ${base} | 
|  | 26 | + | 
|  | 27 | +ARG profile | 
|  | 28 | + | 
|  | 29 | +# curl & ca-certificates: Mina will use curl to download ledger tar when bootstrapping | 
|  | 30 | +# tzdata: Stdlib.open_in_gen expects /etc/localtime to be available | 
|  | 31 | +RUN apt-get update \ | 
|  | 32 | +  && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | 
|  | 33 | +    curl \ | 
|  | 34 | +    ca-certificates \ | 
|  | 35 | +    tzdata \ | 
|  | 36 | +  && rm -rf /var/lib/apt/lists/* | 
|  | 37 | + | 
|  | 38 | +ARG timezone="Asia/Shanghai" | 
|  | 39 | +RUN ln -snf /usr/share/zoneinfo/$timezone /etc/localtime \ | 
|  | 40 | +  && echo $timezone > /etc/timezone | 
|  | 41 | + | 
|  | 42 | +# Copy all dyn libraries | 
|  | 43 | +COPY --from=builder /home/opam/mina/_build_portable/lib /opt/mina/lib | 
|  | 44 | + | 
|  | 45 | +# Copy needed binaries  | 
|  | 46 | +COPY --from=builder \ | 
|  | 47 | +  /home/opam/mina/_build_portable/bin/mina \ | 
|  | 48 | +  /home/opam/mina/_build_portable/bin/mina-libp2p_helper \ | 
|  | 49 | +  /opt/mina/bin/ | 
|  | 50 | + | 
|  | 51 | +# Copy genesis ledgers | 
|  | 52 | +COPY --from=builder /home/opam/mina/genesis_ledgers /opt/mina/data/genesis_ledgers | 
|  | 53 | + | 
|  | 54 | +ENV PATH="/opt/mina/bin:${PATH}" | 
|  | 55 | + | 
|  | 56 | +ENV MINA_PROFILE=${profile}  | 
|  | 57 | + | 
|  | 58 | +ENTRYPOINT mina daemon \ | 
|  | 59 | +  --config-file /opt/mina/data/genesis_ledgers/${MINA_PROFILE}.json \ | 
|  | 60 | +  --peer-list-url https://bootnodes.minaprotocol.com/networks/${MINA_PROFILE}.txt \ | 
|  | 61 | +  --log-level info | 
0 commit comments