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-06 17:43:04 +00:00
|
|
|
# Configure creds for gitea
|
2023-07-07 05:09:18 +00:00
|
|
|
ARG GIT_VDBTO_TOKEN
|
2023-07-01 11:14:49 +00:00
|
|
|
|
2023-06-14 13:03:01 +00:00
|
|
|
# Get and cache deps
|
2023-07-07 04:36:30 +00:00
|
|
|
WORKDIR /plugeth-statediff/
|
2023-07-07 05:09:18 +00:00
|
|
|
COPY go.mod go.sum .
|
2023-07-10 19:24:39 +00:00
|
|
|
RUN [ -n "$GIT_VDBTO_TOKEN" ] && git config --global url."https://$GIT_VDBTO_TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/" ; \
|
2023-07-10 19:13:01 +00:00
|
|
|
go mod download && \
|
2023-07-07 04:36:30 +00:00
|
|
|
rm -f ~/.gitconfig
|
2023-06-14 13:03:01 +00:00
|
|
|
|
2023-07-07 05:09:18 +00:00
|
|
|
COPY . .
|
2023-07-10 18:50:06 +00:00
|
|
|
RUN go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
|
2023-06-14 13:03:01 +00:00
|
|
|
|
2023-07-07 04:36:30 +00:00
|
|
|
FROM alpine:3.18
|
2023-06-14 13:03:01 +00:00
|
|
|
|
|
|
|
COPY --from=builder /plugeth-statediff/statediff.so /usr/local/lib/
|