File tree Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Expand file tree Collapse file tree 1 file changed +4
-23
lines changed Original file line number Diff line number Diff line change 1- FROM golang:1.25-alpine3.22 as builder
2- WORKDIR /app
3- COPY . .
4- RUN
5- RUN go build -ldflags "-s -w" -o main main.go
6-
7- FROM alpine:3.22
8- RUN apk update
9- RUN apk upgrade --no-cache libcrypto3 libssl3 openssl
10- RUN apk --no-cache add ca-certificates
11- RUN addgroup -S app && adduser -S app -G app
12- WORKDIR /app
13- COPY --from=builder /app/main .
14- USER app
15- ENTRYPOINT ["./main" ]
16-
17-
18- FROM --platform=$BUILDPLATFORM golang:1.25-alpine3.22 as builder
1+ FROM golang:1.25-alpine3.22 AS builder
192ARG TARGETOS TARGETARCH TARGETVARIANT
203WORKDIR /app
214COPY . .
22- RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w" -o main main.go
5+ RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-s -w" -o main main.go
236
24- FROM --platform=$TARGETPLATFORM alpine:3.22
25- RUN apk update
26- RUN apk upgrade --no-cache libcrypto3 libssl3 openssl
27- RUN apk --no-cache add ca-certificates
7+ FROM alpine:3.22
8+ RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 openssl && apk --no-cache add ca-certificates
289RUN addgroup -S app && adduser -S app -G app
2910WORKDIR /app
3011COPY --from=builder /app/main .
You can’t perform that action at this time.
0 commit comments