2023-06-23 12:42:55 +00:00
|
|
|
# Using the same base golang image as geth
|
|
|
|
FROM golang:1.20-alpine as builder
|
|
|
|
|
|
|
|
RUN apk add --no-cache gcc musl-dev binutils-gold linux-headers git
|
|
|
|
|
2023-06-24 05:00:21 +00:00
|
|
|
WORKDIR /plugeth-statediff/
|
|
|
|
|
2023-06-23 12:42:55 +00:00
|
|
|
# Get and cache deps
|
2023-06-24 05:00:21 +00:00
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
RUN go mod download
|
2023-06-23 12:42:55 +00:00
|
|
|
|
2023-06-24 05:00:21 +00:00
|
|
|
ADD . .
|
|
|
|
RUN go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
|
2023-06-23 12:42:55 +00:00
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
COPY --from=builder /plugeth-statediff/statediff.so /usr/local/lib/
|