2024-03-28 10:09:04 +00:00
|
|
|
# Using image with same alpine as plugeth,
|
|
|
|
# but go 1.21 to evade https://github.com/Consensys/gnark-crypto/issues/468
|
|
|
|
FROM golang:1.21-alpine3.18 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-03-28 10:09:04 +00:00
|
|
|
WORKDIR /plugeth-statediff
|
2023-07-05 10:15:05 +00:00
|
|
|
COPY go.mod go.sum ./
|
2024-03-28 10:09:04 +00:00
|
|
|
RUN go mod download
|
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/
|