diff --git a/breeze b/breeze index 3e8d2c3f8493c..37cb38756a7c4 100755 --- a/breeze +++ b/breeze @@ -508,6 +508,7 @@ function prepare_command_files() { export COMPOSE_CI_FILE export COMPOSE_PROD_FILE + get_base_image_version # Base python image for the build export PYTHON_BASE_IMAGE=python:${PYTHON_BASE_IMAGE_VERSION}-slim-buster export AIRFLOW_CI_IMAGE="${DOCKERHUB_USER}/${DOCKERHUB_REPO}:${BRANCH_NAME}-python${PYTHON_MAJOR_MINOR_VERSION}-ci" diff --git a/scripts/ci/libraries/_build_images.sh b/scripts/ci/libraries/_build_images.sh index ed894a127e1b7..352975b6b07cb 100644 --- a/scripts/ci/libraries/_build_images.sh +++ b/scripts/ci/libraries/_build_images.sh @@ -311,11 +311,17 @@ function print_build_info() { print_info } +function get_base_image_version() { + # python image version to use + PYTHON_BASE_IMAGE_VERSION=${PYTHON_BASE_IMAGE_VERSION:=${PYTHON_MAJOR_MINOR_VERSION}} +} + # Prepares all variables needed by the CI build. Depending on the configuration used (python version # DockerHub user etc. the variables are set so that other functions can use those variables. function prepare_ci_build() { + get_base_image_version # We use pulled docker image cache by default for CI images to speed up the builds export DOCKER_CACHE=${DOCKER_CACHE:="pulled"} echo @@ -591,6 +597,7 @@ Docker building ${AIRFLOW_CI_IMAGE}. # Prepares all variables needed by the CI build. Depending on the configuration used (python version # DockerHub user etc. the variables are set so that other functions can use those variables. function prepare_prod_build() { + get_base_image_version # We use local docker image cache by default for Production images export DOCKER_CACHE=${DOCKER_CACHE:="local"} echo diff --git a/scripts/ci/libraries/_initialization.sh b/scripts/ci/libraries/_initialization.sh index c41dff995a484..5f2a74251d350 100644 --- a/scripts/ci/libraries/_initialization.sh +++ b/scripts/ci/libraries/_initialization.sh @@ -21,10 +21,6 @@ function initialize_common_environment { # default python Major/Minor version PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:="3.6"} - # python image version to use - # shellcheck disable=SC2034 - PYTHON_BASE_IMAGE_VERSION=${PYTHON_MAJOR_MINOR_VERSION} - # extra flags passed to docker run for CI image # shellcheck disable=SC2034 EXTRA_DOCKER_FLAGS=()