ci(crabbox): harden docker hydration

This commit is contained in:
Peter Steinberger
2026-05-22 13:28:14 +01:00
parent 57db041365
commit f4bdfd46a9
4 changed files with 92 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ docker_build_on_missing_enabled() {
docker_build_command() {
local build_cmd=(docker build)
if [ "${OPENCLAW_DOCKER_BUILD_USE_BUILDX:-0}" = "1" ]; then
if [ "${OPENCLAW_DOCKER_BUILD_USE_BUILDX:-0}" = "1" ] || docker_build_args_need_buildx "$@"; then
build_cmd=(docker buildx build --load)
if [ -n "${OPENCLAW_DOCKER_BUILD_CACHE_FROM:-}" ]; then
build_cmd+=(--cache-from "${OPENCLAW_DOCKER_BUILD_CACHE_FROM}")
@@ -34,6 +34,17 @@ docker_build_command() {
printf '%s\0' env DOCKER_BUILDKIT=1 "${build_cmd[@]}" "$@"
}
docker_build_args_need_buildx() {
for arg in "$@"; do
case "$arg" in
--build-context | --build-context=*)
return 0
;;
esac
done
return 1
}
docker_build_transient_failure() {
local log_file="$1"
grep -Eqi \