From 27b38649e7af9501ff9622cf1740e597ef6a9aab Mon Sep 17 00:00:00 2001 From: Thibault Cohen Date: Mon, 21 Dec 2015 14:49:56 -0500 Subject: [PATCH] Add command in Makefile to get a completly static binary --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index b9de93ffb..188e6373c 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,11 @@ build: "-X main.Version=$(VERSION)" \ ./cmd/telegraf/telegraf.go +build-for-docker: + CGO_ENABLED=0 GOOS=linux go build -o telegraf -ldflags \ + "-X main.Version=$(VERSION)" \ + ./cmd/telegraf/telegraf.go + # Build with race detector dev: prepare go build -race -o telegraf -ldflags \