plugeth-statediff/Dockerfile

26 lines
699 B
Docker

# 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
# Configure creds for gitea
ARG GITEA_TOKEN
RUN echo $GITEA_TOKEN > ~/.token
RUN git config --global credential.username _ # ignored, but prevents prompt
RUN git config --global credential.helper \
'!f() { test "$1" = get && echo "password=$(cat $HOME/.token)"; }; f'
WORKDIR /plugeth-statediff/
# Get and cache deps
COPY go.mod .
COPY go.sum .
RUN go mod download
ADD . .
RUN go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
FROM alpine:latest
COPY --from=builder /plugeth-statediff/statediff.so /usr/local/lib/