mirror of
https://github.com/git-pkgs/proxy.git
synced 2026-11-09 23:59:16 -05:00
CI, the release binaries and swagger take their Go version from go.mod, which pinned 1.26.7 and so missed the stdlib fixes in 1.26.8 to 1.26.10. A toolchain line now sets 1.27.3 for them, and the Docker builder uses the same version. The go line stays at 1.26.7, so source builds with an older local Go still work. golangci-lint 2.13.1 can't read Go 1.27.2+ export data, so CI moves to 2.15.0. Its errcheck flags two test cleanups that dropped the server's exit error; they now check it.
35 lines
667 B
Docker
35 lines
667 B
Docker
FROM --platform=$BUILDPLATFORM golang:1.27.3-alpine AS builder
|
|
|
|
WORKDIR /src
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git
|
|
|
|
# Copy go mod files first for caching
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the binary for the target platform
|
|
ARG TARGETARCH
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /proxy ./cmd/proxy
|
|
|
|
FROM alpine:3.24.2
|
|
|
|
RUN apk add --no-cache ca-certificates git
|
|
|
|
COPY --from=builder /proxy /usr/local/bin/proxy
|
|
|
|
# Create non-root user
|
|
RUN adduser -D -u 1000 proxy
|
|
USER proxy
|
|
|
|
# Default data directory
|
|
WORKDIR /data
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["proxy"]
|
|
CMD ["serve"]
|