File tree Expand file tree Collapse file tree 1 file changed +31
-9
lines changed Expand file tree Collapse file tree 1 file changed +31
-9
lines changed Original file line number Diff line number Diff line change 1- FROM golang:1.23-alpine as builder
1+ # FROM golang:1.23-alpine as builder
22
3- WORKDIR /app
3+ # WORKDIR /app
44
5- COPY go.mod go.sum ./
5+ # COPY go.mod go.sum ./
66
7- RUN go mod tidy
7+ # RUN go mod tidy
8+
9+ # COPY . .
10+
11+ # # Build the Go application for Linux, stripped of debug information
12+ # RUN CGO_ENABLED=0 GOOS=linux go build -o cos2cos
13+
14+ # # Stage 2: Final stage (minimal image)
15+ # FROM alpine
16+
17+ # RUN apk --no-cache add ca-certificates
18+
19+
20+ # # Copy the binary from the builder stage
21+ # COPY --from=builder /app/cos2cos /
22+
23+ # RUN chmod +x /cos2cos
24+
25+ # ENTRYPOINT ["/cos2cos"]
26+
27+
28+ FROM quay.io/projectquay/golang:1.23 AS builder
29+ WORKDIR /go/src/app
830
931COPY . .
1032
33+ RUN go mod tidy
34+
1135# Build the Go application for Linux, stripped of debug information
1236RUN CGO_ENABLED=0 GOOS=linux go build -o cos2cos
1337
1438# Stage 2: Final stage (minimal image)
15- FROM alpine
39+ FROM gcr.io/distroless/static-debian12
1640
17- RUN apk --no-cache add ca-certificates
41+ # RUN apk --no-cache add ca-certificates
1842
1943
2044# Copy the binary from the builder stage
21- COPY --from=builder /app/cos2cos /
22-
23- RUN chmod +x /cos2cos
45+ COPY --from=builder /go/src/app/cos2cos /
2446
2547ENTRYPOINT ["/cos2cos" ]
You can’t perform that action at this time.
0 commit comments