Commit 9df2ea4a authored by Jeff Lowdermilk's avatar Jeff Lowdermilk

Merge pull request #5479 from ArtfulCoder/static_linking

Build statically linked binaries for kubernetes.
parents e37fd2a8 4b24aa2d
...@@ -296,13 +296,13 @@ kube::golang::build_binaries() { ...@@ -296,13 +296,13 @@ kube::golang::build_binaries() {
if [[ ${GOOS} == "windows" ]]; then if [[ ${GOOS} == "windows" ]]; then
bin="${bin}.exe" bin="${bin}.exe"
fi fi
go build -o "${output_path}/${bin}" \ CGO_ENABLED=0 go build -installsuffix cgo -o "${output_path}/${bin}" \
"${goflags[@]:+${goflags[@]}}" \ "${goflags[@]:+${goflags[@]}}" \
-ldflags "${version_ldflags}" \ -ldflags "${version_ldflags}" \
"${binary}" "${binary}"
done done
else else
go install "${goflags[@]:+${goflags[@]}}" \ CGO_ENABLED=0 go install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" \
-ldflags "${version_ldflags}" \ -ldflags "${version_ldflags}" \
"${binaries[@]}" "${binaries[@]}"
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment