Merge branch 'ci/no-cache-blob-recovery' into 'main'
ci(docker): add --no-cache to bypass stale inline cache from missing blob See merge request 2-6/2-6-4/terravault/ordinis!2
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