github.com/cryptotooltop/go-ethereum@v0.0.0-20231103184714-151d1922f3e5/Dockerfile (about)

     1  # Support setting various labels on the final image
     2  ARG COMMIT=""
     3  ARG VERSION=""
     4  ARG BUILDNUM=""
     5  
     6  # Build libzkp dependency
     7  FROM scrolltech/go-rust-builder:go-1.19-rust-nightly-2022-12-10 as chef
     8  WORKDIR app
     9  
    10  FROM chef as planner
    11  COPY ./rollup/circuitcapacitychecker/libzkp/ .
    12  RUN cargo chef prepare --recipe-path recipe.json
    13  
    14  FROM chef as zkp-builder
    15  COPY ./rollup/circuitcapacitychecker/libzkp/rust-toolchain ./
    16  COPY --from=planner /app/recipe.json recipe.json
    17  RUN cargo chef cook --release --recipe-path recipe.json
    18  
    19  COPY ./rollup/circuitcapacitychecker/libzkp .
    20  RUN cargo build --release
    21  RUN find ./ | grep libzktrie.so | xargs -I{} cp {} /app/target/release/
    22  
    23  # Build Geth in a stock Go builder container
    24  FROM scrolltech/go-rust-builder:go-1.19-rust-nightly-2022-12-10 as builder
    25  
    26  ADD . /go-ethereum
    27  COPY --from=zkp-builder /app/target/release/libzkp.so /usr/local/lib/
    28  COPY --from=zkp-builder /app/target/release/libzktrie.so /usr/local/lib/
    29  ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
    30  RUN cd /go-ethereum && env GO111MODULE=on go run build/ci.go install -buildtags circuit_capacity_checker ./cmd/geth
    31  
    32  # Pull Geth into a second stage deploy alpine container
    33  FROM ubuntu:20.04
    34  
    35  RUN apt-get -qq update \
    36      && apt-get -qq install -y --no-install-recommends ca-certificates
    37  
    38  COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
    39  COPY --from=zkp-builder /app/target/release/libzkp.so /usr/local/lib/
    40  COPY --from=zkp-builder /app/target/release/libzktrie.so /usr/local/lib/
    41  ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
    42  
    43  EXPOSE 8545 8546 30303 30303/udp
    44  ENTRYPOINT ["geth"]
    45  
    46  # Add some metadata labels to help programatic image consumption
    47  ARG COMMIT=""
    48  ARG VERSION=""
    49  ARG BUILDNUM=""
    50  
    51  LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"