Exclude all of go from runtime image #4
@@ -1,11 +1,7 @@
|
|||||||
FROM golang:1.22 AS compile
|
FROM golang:1.23 AS compile
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
|
|
||||||
# COPY go.mod go.sum ./
|
|
||||||
# RUN go mod download && go mod verify
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /app ./...
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /app ./...
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user