perf: Go 1.26, BuildKit cache mounts

This commit is contained in:
Hanzo Dev
2026-03-02 11:56:33 -08:00
parent 6433997891
commit 10d036273a
4 changed files with 26 additions and 5 deletions
+10
View File
@@ -0,0 +1,10 @@
.git
.github
*.md
LICENSE
*.test
*.prof
*.out
dist/
pkg/
coverage.out
+6
View File
@@ -53,3 +53,9 @@ coverage.out
# Cross compiled binaries
pkg
# AI assistant config
CLAUDE.md
AGENTS.md
GEMINI.md
QWEN.md
+9 -2
View File
@@ -1,4 +1,5 @@
FROM --platform=$BUILDPLATFORM golang:alpine AS builder
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM golang:1.26-alpine AS builder
ARG VERSION="dev"
ARG GIT_COMMIT
@@ -14,9 +15,15 @@ ENV GOOS=$TARGETOS \
RUN apk add --no-cache ca-certificates && update-ca-certificates
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . /src
RUN go build -trimpath \
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -trimpath \
-ldflags "-w -X server.serverVersion=${VERSION} -X server.gitCommit=${GIT_COMMIT}" \
-o /out/pubsub .
+1 -3
View File
@@ -1,8 +1,6 @@
module github.com/nats-io/nats-server/v2
go 1.25.0
toolchain go1.25.7
go 1.26.0
require (
github.com/antithesishq/antithesis-sdk-go v0.6.0-default-no-op