diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index a16210480db9..3a96ec2ab9c6 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -14,7 +14,10 @@ # This file creates a standard build environment for building Kubernetes -FROM kube-build:cross +# We replace KUBE_BUILD_IMAGE_CROSS in build/common.sh with the actual +# cross-build image tag. +FROM KUBE_BUILD_IMAGE_CROSS + MAINTAINER Joe Beda # (set an explicit GOARM of 5 for maximum compatibility) diff --git a/build/common.sh b/build/common.sh index 51742edf0f50..2b3fcd7795a4 100755 --- a/build/common.sh +++ b/build/common.sh @@ -46,13 +46,9 @@ readonly KUBE_GCS_DELETE_EXISTING="${KUBE_GCS_DELETE_EXISTING:-n}" # Constants readonly KUBE_BUILD_IMAGE_REPO=kube-build -# These get set in verify_prereqs with a unique hash based on KUBE_ROOT -# KUBE_BUILD_IMAGE_TAG= -# KUBE_BUILD_IMAGE="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_TAG}" -# KUBE_BUILD_CONTAINER_NAME=kube-build- -readonly KUBE_BUILD_IMAGE_CROSS_TAG=cross +readonly KUBE_BUILD_GOLANG_VERSION=1.4.2 +readonly KUBE_BUILD_IMAGE_CROSS_TAG="cross-${KUBE_BUILD_GOLANG_VERSION}-1" readonly KUBE_BUILD_IMAGE_CROSS="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_CROSS_TAG}" -readonly KUBE_BUILD_GOLANG_VERSION=1.4 # KUBE_BUILD_DATA_CONTAINER_NAME=kube-build-data- # Here we map the output directories across both the local and remote _output @@ -411,7 +407,7 @@ function kube::build::build_image_built() { function kube::build::ensure_golang() { kube::build::docker_image_exists golang "${KUBE_BUILD_GOLANG_VERSION}" || { [[ ${KUBE_SKIP_CONFIRMATIONS} =~ ^[yY]$ ]] || { - echo "You don't have a local copy of the golang docker image. This image is 450MB." + echo "You don't have a local copy of the golang:${KUBE_BUILD_GOLANG_VERSION} docker image. This image is 450MB." read -p "Download it now? [y/n] " -r echo [[ $REPLY =~ ^[yY]$ ]] || { @@ -466,6 +462,7 @@ function kube::build::build_image() { kube::version::save_version_vars "${build_context_dir}/kube-version-defs" cp build/build-image/Dockerfile ${build_context_dir}/Dockerfile + sed -i "s/KUBE_BUILD_IMAGE_CROSS/${KUBE_BUILD_IMAGE_CROSS}/" ${build_context_dir}/Dockerfile # We don't want to force-pull this image because it's based on a local image # (see kube::build::build_image_cross), not upstream. kube::build::docker_build "${KUBE_BUILD_IMAGE}" "${build_context_dir}" 'false'