-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
32 lines (22 loc) · 891 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM golang:1.14.0
RUN apt-get update -y && apt-get install -y ca-certificates
ADD go.mod /go/src/github.com/minio/m3/go.mod
ADD go.sum /go/src/github.com/minio/m3/go.sum
WORKDIR /go/src/github.com/minio/m3/
# Get dependencies - will also be cached if we won't change mod/sum
RUN go mod download
ADD . /go/src/github.com/minio/m3/
WORKDIR /go/src/github.com/minio/m3/
ENV CGO_ENABLED=0
ARG build_version
ARG build_time
ENV env_build_version=$build_version
ENV env_build_time=$build_time
ENV CGO_ENABLED=0
RUN go build -ldflags "-w -s -X 'github.com/minio/m3/version.BuildTime=$env_build_time' -X 'github.com/minio/m3/version.BuildVersion=$env_build_version'" -a -o m3 ./cmd/m3
FROM scratch
MAINTAINER MinIO Development "[email protected]"
EXPOSE 9009
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /go/src/github.com/minio/m3/m3 .
CMD ["/m3","controller"]