-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command in Makefile to get a completly static binary #458
Conversation
@@ -15,6 +15,11 @@ build: | |||
"-X main.Version=$(VERSION)" \ | |||
./cmd/telegraf/telegraf.go | |||
|
|||
build-for-docker: | |||
GO_ENABLED=0 GOOS=linux go build -o telegraf -ldflags \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean CGO_ENABLED=0
?
Could you also explain why this is necessary? I believe some of the linux system plugins rely on CGO and some of them may not function with this flag.
@sparrc Thanks ! Yeah it's CGO_ENABLED=0 :) |
@titilambert and these are linux containers that don't have access to libc? I'm curious why exactly they can't use binaries that use CGO |
Hum... Maybe I missed something with docker ??? @sparrc 1 . Here my docker file:
2 . I build it
3 . I run it
Did I miss something ? I don't have this error with CGO_ENABLED=0 |
@titilambert do you still need this PR merged? |
@sparrc yes ! I use telegraf in a "FROM strach" container. But are you agree with this "feature" ? |
yes, sorry it took me so long to get to this |
@sparrc Thanks for merge this one ! Thanks ! |
No description provided.