Description
Currently in the kubecross Dockerfile, we precompile the standard library for a number of platforms:
ENV KUBE_CROSSPLATFORMS \
linux/386 \
linux/arm linux/arm64 \
linux/ppc64le \
linux/s390x \
darwin/amd64 darwin/386 \
windows/amd64 windows/386
We only do this when the targetArch is amd64:
RUN targetArch=$(echo $TARGETPLATFORM | cut -f2 -d '/') \
&& if [ ${targetArch} = "amd64" ]; then \
for platform in ${KUBE_CROSSPLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} go install std; done \
&& go clean -cache; \
fi
This was likely done as a way to improve efficiency with amd64 build hosts, but there are a number of arm64 platforms now that we should consider. We should also validate if this is actually useful, or if we end up recompiling the std lib anyway due to the different build flags and modes (cgo vs non-cgo) in use. If it's useful, we should consider the list of platforms and if the current conditional to only do this on amd64 is sufficient.
Removing this current step could reduce the overall size of the kubecross images and would be positive, if we don't need to do it.
/kind cleanup
/sig release
/area release-eng