fix(deploy): grant network.host entitlement for compose bake builds

This commit is contained in:
dev
2026-10-22 17:38:45 +03:00
parent af67526df7
commit a55eff4004
+20 -1
View File
@@ -29,7 +29,26 @@ GIT_COMMIT_DATE="$(git log -1 --format=%cI)"
export GIT_COMMIT GIT_COMMIT_DATE
echo ">> Сборка: $GIT_COMMIT ($GIT_COMMIT_DATE)"
$DC build --build-arg "GIT_COMMIT=$GIT_COMMIT" --build-arg "GIT_COMMIT_DATE=$GIT_COMMIT_DATE" app
build_app() {
if docker buildx version >/dev/null 2>&1 && \
docker buildx bake --help 2>/dev/null | grep -q -- '--allow' && \
$DC build --help 2>/dev/null | grep -q -- '--print'; then
local bake_file
bake_file="$(mktemp)"
if $DC build --print > "$bake_file" 2>/dev/null; then
if docker buildx bake -f "$bake_file" --allow=network.host app; then
rm -f "$bake_file"
return 0
fi
rm -f "$bake_file"
return 1
fi
rm -f "$bake_file"
fi
$DC build --build-arg "GIT_COMMIT=$GIT_COMMIT" --build-arg "GIT_COMMIT_DATE=$GIT_COMMIT_DATE" app
}
build_app
$DC up -d --force-recreate app
echo ">> Проверка"