File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 1- # Stage 1: Build
1+ # See. https://github.com/GoogleContainerTools/distroless/blob/530158861eebdbbf149f7e7e67bfe45eb433a35c/examples/go/Dockerfile
22FROM golang:1.23 AS builder
33
4- # Set the working directory
54WORKDIR /app
6-
7- # Copy the source code
85COPY . .
96
107# Build the Go application with static linking
11- RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o main .
8+ RUN CGO_ENABLED=0 go build -o main .
129
13- # Stage 2: Runtime
14- FROM alpine:latest
10+ FROM gcr.io/distroless/static-debian12
1511
16- # Set the working directory
1712WORKDIR /app
18-
19- # Copy the built binary from the builder stage
2013COPY --from=builder /app/main .
2114
22- # Expose the application port
2315EXPOSE 8080
2416
25- # Command to run the application
2617CMD ["./main" ]
You can’t perform that action at this time.
0 commit comments