forked from celo-org/celo-blockchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.mycelo
40 lines (32 loc) · 1.49 KB
/
Dockerfile.mycelo
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
# Build Geth in a stock Go builder container
FROM golang:1.19-alpine as builder
RUN apk add --no-cache make gcc musl-dev linux-headers git
ADD . /go-ethereum
RUN cd /go-ethereum && make all-musl
FROM node:18-bullseye-slim as monorepo
RUN apt-get update && apt install -y git
ADD ./monorepo_commit /monorepo_commit
RUN git clone https://github.com/celo-org/celo-monorepo /celo-monorepo && \
cd /celo-monorepo && \
git checkout $(cat /monorepo_commit)
RUN apt-get update && \
apt-get install -y lsb-release && \
apt-get install -y curl build-essential python2 pkg-config libsecret-1-dev libudev-dev libusb-dev libusb-1.0-0 bash
RUN cd /celo-monorepo && \
yarn install --network-timeout 100000 --frozen-lockfile && \
yarn cache clean && \
yarn build
# Pull all binaries into a second stage deploy alpine container
FROM alpine:latest
ARG COMMIT_SHA
RUN apk add --no-cache ca-certificates
COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
COPY --from=builder /go-ethereum/monorepo_commit /monorepo_commit
COPY --from=monorepo /celo-monorepo/packages/protocol/build/contracts /contracts/contracts/
COPY --from=monorepo /celo-monorepo/packages/protocol/build/contracts-mento /contracts/contracts-mento/
RUN echo $COMMIT_SHA > /version.txt
# Using "/bin/sh -c" as the entrypoint to allow executing multiple commands directly from docker run
ENTRYPOINT ["/bin/sh", "-c"]
# Add some metadata labels to help programatic image consumption
ARG GETH_COMMIT=""
LABEL GETH_COMMIT="$COMMIT"