Update Dockerfile

This commit is contained in:
Adrien le Maire 2021-02-02 10:45:20 +00:00
parent d3451ee490
commit 27c46552b9

View File

@ -1,3 +1,19 @@
FROM golang:1.15-alpine as builder
LABEL maintainer="MinIO Inc <dev@min.io>"
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"]