mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Use patched go1.7.1 for cross-builds targeting darwin
This commit is contained in:
parent
5f4c8c241e
commit
f769b02c8f
@ -84,9 +84,11 @@ ENV K8S_PATCHED_GOLANG_VERSION=1.7.1 \
|
||||
RUN mkdir -p ${K8S_PATCHED_GOROOT} \
|
||||
&& curl -sSL https://github.com/golang/go/archive/go${K8S_PATCHED_GOLANG_VERSION}.tar.gz | tar -xz -C ${K8S_PATCHED_GOROOT} --strip-components=1
|
||||
|
||||
# We need a patched go1.7.1 for linux/arm (https://github.com/kubernetes/kubernetes/issues/29904)
|
||||
# We need go1.7.1 for all darwin builds (https://github.com/kubernetes/kubernetes/issues/32999)
|
||||
COPY golang-patches/CL28857-go1.7.1-luxas.patch ${K8S_PATCHED_GOROOT}/
|
||||
RUN cd ${K8S_PATCHED_GOROOT} \
|
||||
&& patch -p1 < CL28857-go1.7.1-luxas.patch \
|
||||
&& cd src \
|
||||
&& GOROOT_FINAL=${K8S_PATCHED_GOROOT} GOROOT_BOOTSTRAP=/usr/local/go ./make.bash \
|
||||
&& for platform in linux/arm; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_PATCHED_GOROOT} go install std; done
|
||||
&& for platform in linux/arm darwin/386 darwin/amd64; do GOOS=${platform%/*} GOARCH=${platform##*/} GOROOT=${K8S_PATCHED_GOROOT} go install std; done
|
||||
|
@ -1 +1 @@
|
||||
v1.6.3-7
|
||||
v1.6.3-8
|
||||
|
@ -236,6 +236,7 @@ kube::golang::set_platform_envs() {
|
||||
if [[ ${platform} == "linux/arm" ]]; then
|
||||
export CGO_ENABLED=1
|
||||
export CC=arm-linux-gnueabi-gcc
|
||||
# See https://github.com/kubernetes/kubernetes/issues/29904
|
||||
export GOROOT=${K8S_PATCHED_GOROOT}
|
||||
elif [[ ${platform} == "linux/arm64" ]]; then
|
||||
export CGO_ENABLED=1
|
||||
@ -243,6 +244,9 @@ kube::golang::set_platform_envs() {
|
||||
elif [[ ${platform} == "linux/ppc64le" ]]; then
|
||||
export CGO_ENABLED=1
|
||||
export CC=powerpc64le-linux-gnu-gcc
|
||||
elif [[ ${platform} == "darwin/"* ]]; then
|
||||
# See https://github.com/kubernetes/kubernetes/issues/32999
|
||||
export GOROOT=${K8S_PATCHED_GOROOT}
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user