mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
docker: the docker image will now contain just the static binary
This commit is contained in:
12
Makefile
12
Makefile
@@ -1,4 +1,6 @@
|
||||
LDFLAGS = $(shell go run buildscripts/gen-ldflags.go)
|
||||
DOCKER_LDFLAGS = '-extldflags "-static"'
|
||||
TAG = latest
|
||||
|
||||
all: install
|
||||
|
||||
@@ -53,7 +55,7 @@ test: build
|
||||
@GO15VENDOREXPERIMENT=1 go test $(GOFLAGS) github.com/minio/minio/pkg...
|
||||
|
||||
gomake-all: build
|
||||
@GO15VENDOREXPERIMENT=1 go build -ldflags $(LDFLAGS) -o $(GOPATH)/bin/minio
|
||||
@GO15VENDOREXPERIMENT=1 go build --ldflags $(LDFLAGS) -o $(GOPATH)/bin/minio
|
||||
|
||||
pkg-add:
|
||||
@GO15VENDOREXPERIMENT=1 govendor add $(PKG)
|
||||
@@ -66,6 +68,14 @@ pkg-remove:
|
||||
|
||||
install: gomake-all
|
||||
|
||||
dockerimage: install
|
||||
@echo "Building docker image:" minio:$(TAG)
|
||||
@GO15VENDOREXPERIMENT=1 go build --ldflags $(LDFLAGS) --ldflags $(DOCKER_LDFLAGS) -o minio.dockerimage
|
||||
@mkdir -p export
|
||||
@docker build --rm --tag=minio:$(TAG) .
|
||||
@rmdir export
|
||||
@rm minio.dockerimage
|
||||
|
||||
clean:
|
||||
@echo "Cleaning up all the generated files:"
|
||||
@rm -fv cover.out
|
||||
|
||||
Reference in New Issue
Block a user