File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ readonly RELEASE_IMAGES="${LOCAL_OUTPUT_ROOT}/release-images"
30
30
31
31
KUBE_BUILD_HYPERKUBE=${KUBE_BUILD_HYPERKUBE:- y}
32
32
KUBE_BUILD_CONFORMANCE=${KUBE_BUILD_CONFORMANCE:- y}
33
+ KUBE_BUILD_PULL_LATEST_IMAGES=${KUBE_BUILD_PULL_LATEST_IMAGES:- y}
33
34
34
35
# Validate a ci version
35
36
#
372
373
if [[ " ${base_image} " =~ busybox ]]; then
373
374
echo " COPY nsswitch.conf /etc/" >> " ${docker_file_path} "
374
375
fi
375
- " ${DOCKER[@]} " build --pull -q -t " ${docker_image_tag} " " ${docker_build_path} " > /dev/null
376
+
377
+ # provide `--pull` argument to `docker build` if `KUBE_BUILD_PULL_LATEST_IMAGES`
378
+ # is set to y or Y; otherwise try to build the image without forcefully
379
+ # pulling the latest base image.
380
+ local -a docker_build_opts=()
381
+ if [[ " ${KUBE_BUILD_PULL_LATEST_IMAGES} " =~ [yY] ]]; then
382
+ docker_build_opts+=(" --pull" )
383
+ fi
384
+ " ${DOCKER[@]} " build " ${docker_build_opts[@]} " -q -t " ${docker_image_tag} " " ${docker_build_path} " > /dev/null
376
385
" ${DOCKER[@]} " save " ${docker_image_tag} " > " ${binary_dir} /${binary_name} .tar"
377
386
echo " ${docker_tag} " > " ${binary_dir} /${binary_name} .docker_tag"
378
387
rm -rf " ${docker_build_path} "
You can’t perform that action at this time.
0 commit comments