From 7909588304ba1bd72ab4d42c944fd8a1c583073c Mon Sep 17 00:00:00 2001 From: "Zimin A.N." Date: Sun, 10 May 2026 15:10:46 +0300 Subject: [PATCH] ci(docker): add --no-cache to bypass stale inline cache from missing blob MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After 44395e2 added --pull, pipeline 6032 still fails on docker-app/ projection-writer/read-api with same blob 74e368... missing. --pull pulled base image fine, but BuildKit reads BUILDKIT_INLINE_CACHE из previously-pushed :latest (которое references the lost blob). BuildKit thinks "this blob already in registry, skip push" → manifest references missing blob. --no-cache форсирует rebuild from scratch без inline cache reading. Все blobs пересобираются → pushed заново → manifest is consistent. Stack +2 min per service (3 services = +6 min total pipeline). Acceptable до восстановления Nexus blob storage health. Когда :latest references stable blobs снова — оба флага можно убрать одной revert командой. Sister fix к 44395e2. --- .gitlab-ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2cbc768..1fd1ba4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -187,12 +187,16 @@ build-docs: for i in $(seq 1 30); do docker info >/dev/null 2>&1 && break; sleep 1; done echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY" -u "$REGISTRY_USER" --password-stdin IMG="$REGISTRY/$IMAGE_REPO/$SVC" - # --pull форсирует re-fetch базового image (FROM ...) на каждом build'е → - # если Nexus docker-proxy кэш потерял слой (post disk-full incident), proxy - # лениво re-fetch'ит blob с Docker Hub. Без флага BuildKit cache на runner'е - # держит stale reference на уже-удалённый blob → manifest push fail - # "blob unknown to registry". Стоимость флага — +5-10s на pull проверку. - docker build --pull -f "$DOCKERFILE" \ + # --pull + --no-cache временно для recovery после Nexus blob loss + # (post disk-full incident): + # - --pull: Nexus docker-proxy лениво re-fetch'ит base image с Docker Hub. + # - --no-cache: BuildKit НЕ читает inline cache из previously-pushed :latest + # (которое references missing blob 74e368...). Без этого BuildKit skip'ает + # push любого blob'а который "exists" в старом manifest'е → "blob unknown + # to registry" на manifest push. + # Когда Nexus blob storage стабилизируется, --no-cache можно убрать — + # добавляет ~2 минуты per service на полную пересборку. + docker build --pull --no-cache -f "$DOCKERFILE" \ -t "$IMG:$IMAGE_TAG" -t "$IMG:latest" -t "$IMG:$CI_COMMIT_REF_SLUG" \ --build-arg BUILDKIT_INLINE_CACHE=1 \ "$BUILD_CONTEXT"