diff --git a/ethd b/ethd index cc7b9f7c..9d70382a 100755 --- a/ethd +++ b/ethd @@ -2026,14 +2026,74 @@ __nag_os_update() { } +__docker_df_to_bytes() { + local awk_exe + local num + local unit + + if [[ "$OSTYPE" = "darwin"* ]]; then + awk_exe="gawk" # Built-in awk is BSD and may behave in ways I do not code for + else + awk_exe="awk" + fi + + if [[ "$1" =~ ^([0-9.]+)([kMGTP]?B)$ ]]; then + num="${BASH_REMATCH[1]}" + unit="${BASH_REMATCH[2]}" + else + echo "Docker build cache size parsing failed. This may be a bug" + return + fi + + ${awk_exe} -v num="${num}" -v unit="${unit}" ' + # docker system df reports GB, not GiB + function pow1000(n, i) { r=1; for (i=0;i50GB reclaimable." + __dodocker system prune --force + fi +} + + __pull_and_build() { echo "Building local client images" - __dodocker system prune --force + __prune_docker_cache __docompose --profile tools pull __source_build __docompose --profile tools build --pull } + # Run optional pre-update hook script for custom actions before update/config. # Users can create pre-ethd-update.sh to run validation or preparation steps. __run_pre_update_script() {