diff --git a/build/build.sh b/build/build.sh index 1e01226d9a..d093e33aae 100755 --- a/build/build.sh +++ b/build/build.sh @@ -37,7 +37,8 @@ ldflags=" -X ${repo_path}/version.Branch${ldseparator}${branch} -X ${repo_path}/version.BuildUser${ldseparator}${USER}@${host} -X ${repo_path}/version.BuildDate${ldseparator}${build_date} - -X ${repo_path}/version.GoVersion${ldseparator}${go_version}" + -X ${repo_path}/version.GoVersion${ldseparator}${go_version} + -extldflags \"-static\"" echo " > cadvisor" GOBIN=$PWD godep go install -ldflags "${ldflags}" ${repo_path} diff --git a/integration/runner/runner.go b/integration/runner/runner.go index 3b694279ca..f8d93858b7 100644 --- a/integration/runner/runner.go +++ b/integration/runner/runner.go @@ -204,7 +204,7 @@ func Run() error { // Build cAdvisor. glog.Infof("Building cAdvisor...") - err := RunCommand("godep", "go", "build", "github.com/google/cadvisor") + err := RunCommand("godep", "go", "build", "--ldflags", "-extldflags '-static'", "github.com/google/cadvisor") if err != nil { return err }