1FROM golang:1.17-alpine as builder 2 3LABEL maintainer="MinIO Inc <dev@min.io>" 4 5ENV GOPATH /go 6ENV CGO_ENABLED 0 7ENV GO111MODULE on 8 9RUN \ 10 apk add --no-cache git && \ 11 git clone https://github.com/minio/mc && cd mc && \ 12 go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" 13 14FROM registry.access.redhat.com/ubi8/ubi-minimal:8.4 15 16ARG TARGETARCH 17 18COPY --from=builder /go/bin/mc /usr/bin/mc 19COPY --from=builder /go/mc/CREDITS /licenses/CREDITS 20COPY --from=builder /go/mc/LICENSE /licenses/LICENSE 21 22RUN \ 23 microdnf update --nodocs && \ 24 microdnf install ca-certificates --nodocs && \ 25 microdnf clean all 26 27ENTRYPOINT ["mc"] 28