build: Use Go version in cross image tag

The new tag format is cross-<go version>-<cross version>, starting
with cross-1.5.3-1.

Also bump the image we pre-pull / warn-on to 1.5.3

Fixes #19990
pull/6/head
Zach Loafman 2016-01-22 09:08:35 -08:00
parent ef77ce7147
commit 07c304b43d
2 changed files with 8 additions and 8 deletions

View File

@ -14,7 +14,10 @@
# This file creates a standard build environment for building Kubernetes # 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 <jbeda@google.com> MAINTAINER Joe Beda <jbeda@google.com>
# (set an explicit GOARM of 5 for maximum compatibility) # (set an explicit GOARM of 5 for maximum compatibility)

View File

@ -48,13 +48,9 @@ readonly KUBE_GCS_DELETE_EXISTING="${KUBE_GCS_DELETE_EXISTING:-n}"
# Constants # Constants
readonly KUBE_BUILD_IMAGE_REPO=kube-build readonly KUBE_BUILD_IMAGE_REPO=kube-build
# These get set in verify_prereqs with a unique hash based on KUBE_ROOT readonly KUBE_BUILD_GOLANG_VERSION=1.5.3
# KUBE_BUILD_IMAGE_TAG=<hash> readonly KUBE_BUILD_IMAGE_CROSS_TAG="cross-${KUBE_BUILD_GOLANG_VERSION}-1"
# KUBE_BUILD_IMAGE="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_TAG}"
# KUBE_BUILD_CONTAINER_NAME=kube-build-<hash>
readonly KUBE_BUILD_IMAGE_CROSS_TAG=cross
readonly KUBE_BUILD_IMAGE_CROSS="${KUBE_BUILD_IMAGE_REPO}:${KUBE_BUILD_IMAGE_CROSS_TAG}" 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-<hash> # KUBE_BUILD_DATA_CONTAINER_NAME=kube-build-data-<hash>
# Here we map the output directories across both the local and remote _output # Here we map the output directories across both the local and remote _output
@ -416,7 +412,7 @@ function kube::build::build_image_built() {
function kube::build::ensure_golang() { function kube::build::ensure_golang() {
kube::build::docker_image_exists golang "${KUBE_BUILD_GOLANG_VERSION}" || { kube::build::docker_image_exists golang "${KUBE_BUILD_GOLANG_VERSION}" || {
[[ ${KUBE_SKIP_CONFIRMATIONS} =~ ^[yY]$ ]] || { [[ ${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 read -p "Download it now? [y/n] " -r
echo echo
[[ $REPLY =~ ^[yY]$ ]] || { [[ $REPLY =~ ^[yY]$ ]] || {
@ -476,6 +472,7 @@ function kube::build::build_image() {
kube::version::save_version_vars "${build_context_dir}/kube-version-defs" kube::version::save_version_vars "${build_context_dir}/kube-version-defs"
cp build/build-image/Dockerfile ${build_context_dir}/Dockerfile 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 # 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. # (see kube::build::build_image_cross), not upstream.
kube::build::docker_build "${KUBE_BUILD_IMAGE}" "${build_context_dir}" 'false' kube::build::docker_build "${KUBE_BUILD_IMAGE}" "${build_context_dir}" 'false'