From 23a58eb5daca1029f2ce0ac8e9e2f3a6dcda2a6b Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sat, 31 Dec 2016 20:49:05 -0800 Subject: [PATCH] mc: Introduce new Dockerfile for mc. (#1938) This is to build `mc` at hub.docker.com Fixes #1917 --- Dockerfile | 14 ++++++++++++++ main.go | 10 ++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..bf949cf4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.7-alpine + +WORKDIR /go/src/app + +COPY . /go/src/app + +RUN \ + apk add --no-cache git && \ + go-wrapper download && \ + go-wrapper install -ldflags "$(go run buildscripts/gen-ldflags.go)" && \ + rm -rf /go/pkg /go/src && \ + apk del git + +ENTRYPOINT ["mc"] diff --git a/main.go b/main.go index 0d2e12e2..e8d38411 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,5 @@ /* - * Minio Client (C) 2014, 2015 Minio, Inc. + * Minio Client (C) 2014, 2015, 2016 Minio, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,13 @@ * limitations under the License. */ -package main +/* + * Below main package has canonical imports for 'go get' and 'go build' + * to work with all other clones of github.com/minio/mc repository. For + * more information refer https://golang.org/doc/go1.4#canonicalimports + */ + +package main // import "github.com/minio/mc" import mc "github.com/minio/mc/cmd"