mirror of https://github.com/k3s-io/k3s
Merge pull request #5479 from ArtfulCoder/static_linking
Build statically linked binaries for kubernetes.pull/6/head
commit
9df2ea4aef
|
@ -296,13 +296,13 @@ kube::golang::build_binaries() {
|
|||
if [[ ${GOOS} == "windows" ]]; then
|
||||
bin="${bin}.exe"
|
||||
fi
|
||||
go build -o "${output_path}/${bin}" \
|
||||
CGO_ENABLED=0 go build -installsuffix cgo -o "${output_path}/${bin}" \
|
||||
"${goflags[@]:+${goflags[@]}}" \
|
||||
-ldflags "${version_ldflags}" \
|
||||
"${binary}"
|
||||
done
|
||||
else
|
||||
go install "${goflags[@]:+${goflags[@]}}" \
|
||||
CGO_ENABLED=0 go install -installsuffix cgo "${goflags[@]:+${goflags[@]}}" \
|
||||
-ldflags "${version_ldflags}" \
|
||||
"${binaries[@]}"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue