2023-06-14 13:03:01 +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-07-01 10:48:36 +00:00
|
|
|
# FIXME - setup for dev deps
|
|
|
|
RUN apk add --no-cache openssh
|
|
|
|
COPY _dev/.ssh /root/.ssh
|
|
|
|
COPY _dev/.gitconfig /root/
|
|
|
|
|
2023-07-01 11:14:49 +00:00
|
|
|
WORKDIR /plugeth-statediff/
|
|
|
|
|
2023-06-14 13:03:01 +00:00
|
|
|
# Get and cache deps
|
2023-07-01 11:14:49 +00:00
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
RUN go mod download
|
2023-06-14 13:03:01 +00:00
|
|
|
|
2023-07-01 11:14:49 +00:00
|
|
|
ADD . .
|
|
|
|
RUN go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
|
2023-06-14 13:03:01 +00:00
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
COPY --from=builder /plugeth-statediff/statediff.so /usr/local/lib/
|