build.sh 739 B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. # Build the SM121-patched GLM-5.3-Flash NVFP4 image.
  3. #
  4. # Generic driver: forwards every KEY=VAL pin in versions.env as a --build-arg
  5. # to the Dockerfile. TAG is set by the sm121 launcher to the recipe's
  6. # docker_image (manual build: TAG=glm53-flash-nvfp4:local bash build.sh).
  7. set -euo pipefail
  8. cd "$(dirname "$0")"
  9. TAG="${TAG:-glm53-flash-nvfp4:local}"
  10. ARGS=()
  11. while IFS= read -r line; do
  12. case "$line" in
  13. ''|\#*) continue ;;
  14. esac
  15. key="${line%%=*}"; val="${line#*=}"
  16. [ -n "$key" ] && ARGS+=(--build-arg "${key}=${val}")
  17. done < versions.env
  18. echo "=== Building ${TAG} ==="
  19. DOCKER_BUILDKIT=1 docker build "${ARGS[@]}" --progress=plain -t "${TAG}" -f Dockerfile . 2>&1
  20. echo "=== Done: ${TAG} ==="