Files
2026-10-02 20:16:39 +03:00

17 lines
542 B
Docker

FROM golang:1.24.8-alpine3.22 AS build
ARG MC_VERSION
RUN apk add --no-cache git
RUN git clone --depth 1 --branch "${MC_VERSION}" https://github.com/minio/mc.git /src/mc
WORKDIR /src/mc
RUN go mod download
RUN LDFLAGS="$(MC_RELEASE=RELEASE go run buildscripts/gen-ldflags.go)" && \
GOMAXPROCS=2 GOMEMLIMIT=1GiB CGO_ENABLED=0 go build -p=1 -tags kqueue -trimpath -ldflags "$LDFLAGS" -o /out/mc .
FROM alpine:3.22.2
COPY --from=build /out/mc /usr/local/bin/mc
COPY infra/minio/bootstrap.sh /usr/local/bin/bootstrap.sh
ENTRYPOINT ["mc"]