ci(docker): add --no-cache to bypass stale inline cache from missing blob
After44395e2added --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.
This commit is contained in:
+10
-6
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user