2024-04-13 10:36:15 +00:00
|
|
|
# Using image with same alpine as plugeth,
|
|
|
|
# but go 1.21 to evade https://github.com/Consensys/gnark-crypto/issues/468
|
2024-06-26 14:20:15 +00:00
|
|
|
FROM golang:1.21-alpine as builder
|
2023-06-23 12:42:55 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache gcc musl-dev binutils-gold linux-headers git
|
|
|
|
|
2023-07-05 10:15:05 +00:00
|
|
|
# Configure creds for gitea
|
|
|
|
ARG GIT_VDBTO_TOKEN
|
2023-06-24 05:00:21 +00:00
|
|
|
|
2023-06-23 12:42:55 +00:00
|
|
|
# Get and cache deps
|
2024-04-13 10:36:15 +00:00
|
|
|
WORKDIR /plugeth-statediff
|
2023-07-05 10:15:05 +00:00
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN if [ -n "$GIT_VDBTO_TOKEN" ]; then git config --global url."https://$GIT_VDBTO_TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"; fi && \
|
|
|
|
go mod download && \
|
|
|
|
rm -f ~/.gitconfig
|
2023-06-23 12:42:55 +00:00
|
|
|
|
2023-07-05 10:15:05 +00:00
|
|
|
COPY . .
|
2023-06-24 05:00:21 +00:00
|
|
|
RUN go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
|
2023-06-23 12:42:55 +00:00
|
|
|
|
2023-07-05 10:15:05 +00:00
|
|
|
FROM alpine:3.18
|
2023-06-23 12:42:55 +00:00
|
|
|
|
|
|
|
COPY --from=builder /plugeth-statediff/statediff.so /usr/local/lib/
|