File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1
22FROM golang:1.25-alpine AS builder
33
4- ENV GOEXPERIMENT=greenteagc
5-
64WORKDIR /src
75
86# Copy dependency files first for better layer caching
@@ -19,11 +17,13 @@ COPY . .
1917RUN --mount=type=cache,target=/go/pkg/mod \
2018 go generate .
2119
20+ ENV GOEXPERIMENT=greenteagc CGO_ENABLED=0 GOOS=linux
21+
2222# Build the applications with cache mount for build cache
2323RUN --mount=type=cache,target=/root/.cache/go-build \
2424 --mount=type=cache,target=/go/pkg/mod \
25- CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o backend ./cmd/backend && \
26- CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o admin-cli ./cmd/admin-cli
25+ go build -ldflags="-w -s" -trimpath -o backend ./cmd/backend && \
26+ go build -ldflags="-w -s" -trimpath -o admin-cli ./cmd/admin-cli
2727
2828# Final stage with minimal runtime image
2929FROM alpine:latest AS runtime
You can’t perform that action at this time.
0 commit comments