Skip to content

Commit

Permalink
Logs in to Github Registry when preparing cache (#21069)
Browse files Browse the repository at this point in the history
Whe we are preparing cache on CI, we should login to the
GitHub registry (using GITHUB_TOKEN) in order for --cache-to
to be able to push images.
  • Loading branch information
potiuk authored and jedcunningham committed Jan 27, 2022
1 parent b1862ca commit cc9a034
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/ci/libraries/_build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ function build_images::build_ci_image() {
exit 1
fi
if [[ ${PREPARE_BUILDX_CACHE} == "true" ]]; then
# we need to login to docker registry so that we can push cache there
build_images::login_to_docker_registry
docker_ci_cache_directive+=(
"--cache-to=type=registry,ref=${AIRFLOW_CI_IMAGE}:cache"
"--load"
Expand Down Expand Up @@ -624,6 +626,8 @@ function build_images::build_prod_images() {
exit 1
fi
if [[ ${PREPARE_BUILDX_CACHE} == "true" ]]; then
# we need to login to docker registry so that we can push cache there
build_images::login_to_docker_registry
# Cache for prod image contains also build stage for buildx when mode=max specified!
docker_cache_prod_directive+=(
"--cache-to=type=registry,ref=${AIRFLOW_PROD_IMAGE}:cache,mode=max"
Expand Down

0 comments on commit cc9a034

Please sign in to comment.