diff --git a/Dockerfile b/Dockerfile index bb6a40494..f4483e412 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,32 @@ -FROM golang:1.10.1-alpine3.7 +FROM golang:1.10.4-alpine3.7 LABEL maintainer="Minio Inc " ENV GOPATH /go -ENV PATH $PATH:$GOPATH/bin ENV CGO_ENABLED 0 + +WORKDIR /go/src/github.com/minio/ + +RUN \ + apk add --no-cache git && \ + go get -v -d github.com/minio/minio && \ + cd /go/src/github.com/minio/minio && \ + go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" + +FROM alpine:3.7 + ENV MINIO_UPDATE off ENV MINIO_ACCESS_KEY_FILE=access_key \ MINIO_SECRET_KEY_FILE=secret_key -WORKDIR /go/src/github.com/minio/ +EXPOSE 9000 +COPY --from=0 /go/bin/minio /usr/bin/minio COPY dockerscripts/docker-entrypoint.sh dockerscripts/healthcheck.sh /usr/bin/ RUN \ apk add --no-cache ca-certificates 'curl>7.61.0' && \ - apk add --no-cache --virtual .build-deps git && \ - echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \ - go get -v -d github.com/minio/minio && \ - cd /go/src/github.com/minio/minio && \ - go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" && \ - rm -rf /go/pkg /go/src /usr/local/go && apk del .build-deps - -EXPOSE 9000 + echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf ENTRYPOINT ["/usr/bin/docker-entrypoint.sh"]