From e95dd01a53b86c71a634a11fc88f123f12f8e811 Mon Sep 17 00:00:00 2001 From: Isaac Hollander McCreery Date: Tue, 19 Jan 2016 17:08:34 -0800 Subject: [PATCH 1/2] Pin golang build to 1.4.2 instead of floating on 1.4 --- build/build-image/cross/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build-image/cross/Dockerfile b/build/build-image/cross/Dockerfile index 905394a027d9..7da44b234deb 100644 --- a/build/build-image/cross/Dockerfile +++ b/build/build-image/cross/Dockerfile @@ -15,7 +15,7 @@ # This file creates a standard build environment for building cross # platform go binary for the architecture kubernetes cares about. -FROM golang:1.4 +FROM golang:1.4.2 MAINTAINER Joe Beda ENV KUBE_CROSSPLATFORMS \ From 041f152e804faf147f515890265fe3e92a274891 Mon Sep 17 00:00:00 2001 From: Isaac Hollander McCreery Date: Tue, 19 Jan 2016 17:28:48 -0800 Subject: [PATCH 2/2] Add flag to force pull on docker build --- build/common.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/common.sh b/build/common.sh index cbc681f707c5..1b858a38bce0 100755 --- a/build/common.sh +++ b/build/common.sh @@ -480,7 +480,9 @@ 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 - kube::build::docker_build "${KUBE_BUILD_IMAGE}" "${build_context_dir}" + # 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' } # Build the kubernetes golang cross base image. @@ -496,10 +498,12 @@ function kube::build::build_image_cross() { # Build a docker image from a Dockerfile. # $1 is the name of the image to build # $2 is the location of the "context" directory, with the Dockerfile at the root. +# $3 is the value to set the --pull flag for docker build; true by default function kube::build::docker_build() { local -r image=$1 local -r context_dir=$2 - local -ra build_cmd=("${DOCKER[@]}" build -t "${image}" "${context_dir}") + local -r pull="${3:-true}" + local -ra build_cmd=("${DOCKER[@]}" build -t "${image}" "--pull=${pull}" "${context_dir}") kube::log::status "Building Docker image ${image}." local docker_output