Images: Extract modules. (#13123)
Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
parent
1bcf93c1c3
commit
6b12ef748e
7 changed files with 60 additions and 8 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue