Skip to content

Commit

Permalink
Add flag to force pull on docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Hollander McCreery committed Jan 20, 2016
1 parent e95dd01 commit 041f152
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

1 comment on commit 041f152

@k8s-teamcity-mesosphere

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TeamCity OSS :: Kubernetes Mesos :: 4 - Smoke Tests Build 12071 outcome was SUCCESS
Summary: Tests passed: 1, ignored: 214 Build time: 00:04:19

Please sign in to comment.