plugeth-statediff/Dockerfile
Thomas E Lackey 252a4015c4
Some checks failed
Test / Run unit tests (pull_request) Failing after 47s
Test / Run integration tests (pull_request) Failing after 21s
49: Use a Personal Access Token to access private modulees.
2023-07-06 14:52:36 -05:00

24 lines
755 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
ARG gitea_access_token
ENV GITEA_ACCESS_TOKEN=$gitea_access_token
# Get and cache deps
COPY go.mod /plugeth-statediff/
COPY go.sum /plugeth-statediff/
RUN if [ -n "$GITEA_ACCESS_TOKEN" ]; then git config --global url."https://$GITEA_ACCESS_TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"; fi && \
cd /plugeth-statediff && \
go mod download && \
rm -f ~/.gitconfig
ADD . /plugeth-statediff
RUN cd /plugeth-statediff && \
go build --tags linkgeth --buildmode=plugin --trimpath -o statediff.so ./main
FROM alpine:3.18
COPY --from=builder /plugeth-statediff/statediff.so /usr/local/lib/