-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Supported to compile statically? #1227
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
Comments
/cc @vishh |
Static compile works fine, haven't gone through the tests though: export GOPATH=~/src/go
export PATH="$PATH:$GOPATH/bin"
apt-get install golang-go # build does not work in alpine
# https://github.com/kubernetes/kubernetes/issues/19464
git clone --depth 1 https://github.com/google/cadvisor.git
go get github.com/tools/godep
go get -d github.com/google/cadvisor
# build statically for scratch image
godep go build --ldflags '-extldflags "-static"' github.com/google/cadvisor The important part is |
If you can push a patch with this change, we can have the CI run all the tests. |
It seems like it's these files that are using
Of course, the best way of fixing it would be to workaround/not have to depend on these C libraries, but I guess it's just fine with static CGO linking. |
closing via #1299 |
kubelet
in Kubernetes depends oncAdvisor
, and ifkubelet
is compiled statically, it complains loudly thatcAdvisor
isn't bundled and exits.So I wonder if there are some technical difficulties to compile
cAdvisor
statically?I haven't tested it yet
If
cAdvisor
works fine when it's statically built, we may close this and open one on the Kubernetes side.The text was updated successfully, but these errors were encountered: