From ae6b1299f2803badff8ea4c46cc84198633533a4 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Sat, 24 Feb 2024 20:30:00 +0100 Subject: [PATCH] fix: [compose-core] make image local cache also fetched before looking on ``$COMPOSE_DOCKER_REGISTRY`` --- bin/compose-core | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index 8433490..448e901 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -1665,16 +1665,16 @@ service_ensure_image_ready() { .services.[\"${service_quoted}\"].image = \"${charm_image_name}:${hash}\"" \ "$_CURRENT_DOCKER_COMPOSE" || return 1 - if [ "$COMPOSE_ACTION" != "build" ] && docker_has_image "${charm_image_name}:${hash}"; then - if [ -n "$DEBUG" ]; then - Elt "using ${DARKPINK}$charm${NORMAL}'s image from local cache" >&2 - print_status noop >&2 - Feed >&2 - fi - cache:image:registry:put "$charm" "$hash" "$service" || return 1 - printf "%s" "${charm_image_name}:${hash}" | tee "$cache_file" - return $? + fi + if [ "$COMPOSE_ACTION" != "build" ] && docker_has_image "${charm_image_name}:${hash}"; then + if [ -n "$DEBUG" ]; then + Elt "using ${DARKPINK}$charm${NORMAL}'s image from local cache" >&2 + print_status noop >&2 + Feed >&2 fi + cache:image:registry:put "$charm" "$hash" "$service" || return 1 + printf "%s" "${charm_image_name}:${hash}" | tee "$cache_file" + return $? fi ## Can we pull it ? Let's check on $COMPOSE_DOCKER_REGISTRY