From 27c46552b917e8d4789574ef15cac5635b85d09c Mon Sep 17 00:00:00 2001 From: Adrien le Maire Date: Tue, 2 Feb 2021 10:45:20 +0000 Subject: [PATCH] Update Dockerfile --- minio/Dockerfile | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/minio/Dockerfile b/minio/Dockerfile index 4068110..79d4390 100644 --- a/minio/Dockerfile +++ b/minio/Dockerfile @@ -1,3 +1,19 @@ +FROM golang:1.15-alpine as builder + +LABEL maintainer="MinIO Inc " +ARG VERSION +ARG TARGETARCH +ENV VERSION $VERSION +ENV GOPATH /go +ENV CGO_ENABLED 0 +ENV GO111MODULE on + +RUN \ + apk add --no-cache git && \ + git clone -b ${VERSION} --depth 1 https://github.com/minio/minio && cd minio && \ + go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" + + FROM alpine:3.13.0 ENV MINIO_ACCESS_KEY_FILE=access_key \ @@ -8,18 +24,14 @@ ENV MINIO_ACCESS_KEY_FILE=access_key \ EXPOSE 9000 -COPY entrypoint.sh /usr/bin/docker-entrypoint.sh - RUN \ apk add --no-cache ca-certificates 'curl>7.61.0' 'su-exec>=0.2' && \ echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf ARG VERSION -ARG TARGETARCH ENV VERSION $VERSION -ADD https://dl.min.io/server/minio/release/linux-${TARGETARCH}/archive/minio.${VERSION} /usr/bin/minio - -RUN chmod +x /usr/bin/minio +COPY --from=builder /go/bin/minio /usr/bin/minio +COPY --from=builder /go/minio/dockerscripts/docker-entrypoint.sh /usr/bin/ ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]