Images: Extract modules. (#13123)

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
k8s-infra-cherrypick-robot 2025-03-30 08:44:35 -07:00 committed by GitHub
parent 1bcf93c1c3
commit 6b12ef748e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 60 additions and 8 deletions

View file

@ -4,10 +4,8 @@ FROM golang:${GOLANG_VERSION}-alpine3.21 as build
WORKDIR /go/src/greeter-server
COPY main.go .
RUN go mod init greeter-server && \
go mod tidy && \
go build -o /greeter-server main.go
COPY . .
RUN go build -o /greeter-server
FROM gcr.io/distroless/base-debian10