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 RUN apk add --no-cache curl openssl postgresql17-client redis && \ addgroup -g 10001 messenger && \ adduser -D -H -u 10001 -G messenger messenger COPY --from=build /out/mc /usr/local/bin/mc COPY infra/minio/bootstrap.sh /usr/local/bin/bootstrap.sh USER 10001:10001 ENTRYPOINT ["mc"]