From 0146a9d592194c2141851565ba7bb8bf90351b8b Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 4 Apr 2019 10:13:33 -0700 Subject: [PATCH] Fix docker files to enable GO111MODULE --- Dockerfile | 12 +++++------- Dockerfile.dev | 2 +- Dockerfile.release | 10 ++++------ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e363606e..5cbb5d3f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,18 @@ -FROM golang:1.12-alpine3.7 +FROM golang:1.12-alpine LABEL maintainer="Minio Inc " ENV GOPATH /go ENV CGO_ENABLED 0 - -WORKDIR /go/src/github.com/minio/ +ENV GO111MODULE on RUN \ apk add --no-cache git && \ - go get -v -d github.com/minio/minio && \ - cd /go/src/github.com/minio/minio && \ + git clone https://github.com/minio/minio && cd minio && \ go install -v -ldflags "$(go run buildscripts/gen-ldflags.go)" && \ - go build -ldflags "-s -w" -o /usr/bin/healthcheck dockerscripts/healthcheck.go + cd dockerscripts; go build -ldflags "-s -w" -o /usr/bin/healthcheck healthcheck.go -FROM alpine:3.7 +FROM alpine:3.9 ENV MINIO_UPDATE off ENV MINIO_ACCESS_KEY_FILE=access_key \ diff --git a/Dockerfile.dev b/Dockerfile.dev index f42501688..fc8cbad0b 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM alpine:3.7 +FROM alpine:3.9 LABEL maintainer="Minio Inc " diff --git a/Dockerfile.release b/Dockerfile.release index 73c6b8235..e8ae2af79 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -1,17 +1,15 @@ -FROM golang:1.12-alpine3.7 +FROM golang:1.12-alpine ENV GOPATH /go ENV CGO_ENABLED 0 - -WORKDIR /go/src/github.com/minio/ +ENV GO111MODULE on RUN \ apk add --no-cache git && \ - go get -v -d github.com/minio/minio && \ - cd /go/src/github.com/minio/minio/dockerscripts && \ + git clone https://github.com/minio/minio && cd minio/dockerscripts && \ go build -ldflags "-s -w" -o /usr/bin/healthcheck healthcheck.go -FROM alpine:3.7 +FROM alpine:3.9 LABEL maintainer="Minio Inc "