Thomas E Lackey
2bd312f0d0
I left it unchanged in the PR, but I would recommend a variable name other than `GITEA_TOKEN`, as I suspect that will be used by Gitea at some future date--like Github use `GITHUB_TOKEN`--and cause confusion since this is not the same token. Something like `GIT_VDB_TO_TOKEN` might do, since we could follow the `HOST_NAME_TOKEN` pattern for other repos if needed. Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com> Reviewed-on: #4 Co-authored-by: Thomas E Lackey <telackey@noreply.git.vdb.to> Co-committed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
23 lines
632 B
Docker
23 lines
632 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
|
|
|
|
# Get and cache deps
|
|
WORKDIR /plugeth-statediff/
|
|
COPY go.mod .
|
|
COPY go.sum .
|
|
RUN if [ -n "$GITEA_TOKEN" ]; then git config --global url."https://$GITEA_TOKEN:@git.vdb.to/".insteadOf "https://git.vdb.to/"; fi && \
|
|
go mod download && \
|
|
rm -f ~/.gitconfig
|
|
|
|
ADD . .
|
|
RUN 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/
|