25 lines
723 B
Docker
25 lines
723 B
Docker
FROM golang:1.25.1-alpine3.22 AS builder
|
|
|
|
ARG MINIO_VERSION=RELEASE.2025-10-15T17-29-55Z
|
|
|
|
RUN apk add --no-cache bash git
|
|
RUN git clone --branch "${MINIO_VERSION}" --depth 1 https://github.com/minio/minio.git /src
|
|
|
|
WORKDIR /src
|
|
RUN LDFLAGS="$(MINIO_RELEASE=RELEASE go run buildscripts/gen-ldflags.go)" && \
|
|
CGO_ENABLED=0 go build -tags kqueue -trimpath --ldflags "${LDFLAGS}" -o /out/minio .
|
|
|
|
FROM alpine:3.22
|
|
|
|
RUN apk add --no-cache ca-certificates && \
|
|
addgroup -S -g 1000 minio && \
|
|
adduser -S -D -H -u 1000 -G minio minio && \
|
|
install -d -o minio -g minio /data
|
|
|
|
COPY --from=builder /out/minio /usr/local/bin/minio
|
|
|
|
USER minio:minio
|
|
EXPOSE 9000 9001
|
|
VOLUME ["/data"]
|
|
ENTRYPOINT ["/usr/local/bin/minio"]
|