32 lines · 973 B · Dockerfile
RawDownload
# syntax=docker/dockerfile:1.7 ARG GO_VERSION=1.26.5ARG ALPINE_VERSION=3.24 FROM golang:${GO_VERSION}-alpine AS buildRUN apk add --no-cache ca-certificates gitWORKDIR /srcCOPY go.mod go.sum ./RUN go mod downloadCOPY . .ARG VERSION=devRUN CGO_ENABLED=0 GOOS=linux go build -trimpath \    -ldflags="-s -w -X github.com/openclaw/gitcrawl/internal/cli.version=${VERSION}" \    -o /out/gitcrawl ./cmd/gitcrawl FROM alpine:${ALPINE_VERSION}RUN apk add --no-cache ca-certificates git openssh-client tzdata \    && adduser -D -u 10001 -h /home/gitcrawl gitcrawl \    && mkdir -p /data/config /data/data /data/cache /data/state \    && chown -R gitcrawl:gitcrawl /dataENV HOME=/home/gitcrawl \    XDG_CONFIG_HOME=/data/config \    XDG_DATA_HOME=/data/data \    XDG_CACHE_HOME=/data/cache \    XDG_STATE_HOME=/data/stateVOLUME ["/data"]WORKDIR /dataCOPY --from=build /out/gitcrawl /usr/local/bin/gitcrawlUSER gitcrawlENTRYPOINT ["gitcrawl"]CMD ["--help"]