v1.0.0: here we go again

This commit is contained in:
2026-01-10 17:06:25 +04:00
parent 25d4762a3c
commit 2d7ba34cb8
68 changed files with 6805 additions and 4548 deletions

View File

@@ -1,17 +1,29 @@
FROM golang:1.25-alpine AS builder
ARG GO_VERSION=required
FROM docker.io/library/golang:${GO_VERSION}-alpine AS builder
ARG VERSION=unknown
ARG GIT_COMMIT=unknown
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN --mount=type=bind,source=./go.mod,target=./go.mod \
--mount=type=bind,source=./go.sum,target=./go.sum \
go mod download
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o dodo
RUN --mount=type=bind,source=./,target=./ \
CGO_ENABLED=0 GOEXPERIMENT=greenteagc go build \
-ldflags "-X 'go.aykhans.me/sarin/internal/version.Version=${VERSION}' \
-X 'go.aykhans.me/sarin/internal/version.GitCommit=${GIT_COMMIT}' \
-X 'go.aykhans.me/sarin/internal/version.BuildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)' \
-X 'go.aykhans.me/sarin/internal/version.GoVersion=$(go version)' \
-s -w" \
-o /sarin ./cmd/cli/main.go
FROM gcr.io/distroless/static-debian12:latest
WORKDIR /
COPY --from=builder /src/dodo /dodo
COPY --from=builder /sarin /sarin
ENTRYPOINT ["./dodo"]
ENTRYPOINT ["./sarin"]