fix: use go mod tidy in Dockerfile
All checks were successful
/ deploy (push) Successful in 1m6s

This commit is contained in:
fnkit 2026-02-17 17:06:52 +00:00
parent c979088e0b
commit b74b331dd5

View file

@ -1,12 +1,10 @@
FROM golang:1.21 AS builder
FROM golang:1.22 AS builder
LABEL fnkit.fn="true"
WORKDIR /app
COPY go.* ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o server ./cmd/main.go
RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -o server ./cmd/main.go
FROM gcr.io/distroless/static-debian11
FROM gcr.io/distroless/static-debian12
COPY --from=builder /app/server /server
ENV FUNCTION_TARGET=HelloWorld
EXPOSE 8080