build(docker): unify Go build images and use distroless for s3config
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.27.1-alpine3.24 AS build
|
FROM golang:1.27.1 AS build
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
RUN go install github.com/pressly/goose/v3/cmd/goose@v3.28.0
|
RUN go install github.com/pressly/goose/v3/cmd/goose@v3.28.0
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
FROM golang:1.27.1-alpine3.24 AS build
|
FROM golang:1.27.1 AS build
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
@@ -8,6 +8,6 @@ RUN go mod download
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN go build -o /out/s3config ./cmd/s3config
|
RUN go build -o /out/s3config ./cmd/s3config
|
||||||
|
|
||||||
FROM alpine:3.24
|
FROM gcr.io/distroless/static-debian12:nonroot
|
||||||
COPY --from=build /out/s3config /usr/local/bin/s3config
|
COPY --from=build /out/s3config /usr/local/bin/s3config
|
||||||
ENTRYPOINT ["/usr/local/bin/s3config"]
|
ENTRYPOINT ["/usr/local/bin/s3config"]
|
||||||
|
|||||||
Reference in New Issue
Block a user