Skip to content

Commit c339a0c

Browse files
committed
Compile cAdvisor statically
1 parent d08cd24 commit c339a0c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build/build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ ldflags="
3737
-X ${repo_path}/version.Branch${ldseparator}${branch}
3838
-X ${repo_path}/version.BuildUser${ldseparator}${USER}@${host}
3939
-X ${repo_path}/version.BuildDate${ldseparator}${build_date}
40-
-X ${repo_path}/version.GoVersion${ldseparator}${go_version}"
40+
-X ${repo_path}/version.GoVersion${ldseparator}${go_version}
41+
-extldflags \"-static\""
4142

4243
echo " > cadvisor"
4344
GOBIN=$PWD godep go install -ldflags "${ldflags}" ${repo_path}

integration/runner/runner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func Run() error {
204204

205205
// Build cAdvisor.
206206
glog.Infof("Building cAdvisor...")
207-
err := RunCommand("godep", "go", "build", "github.com/google/cadvisor")
207+
err := RunCommand("godep", "go", "build", "--ldflags", "-extldflags '-static'", "github.com/google/cadvisor")
208208
if err != nil {
209209
return err
210210
}

0 commit comments

Comments
 (0)