build.sh 911 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env bash
  2. # Build the SM121 DeepSeek-V4-Flash-Vision-Exp image. The generic driver
  3. # forwards every KEY=VAL pin in versions.env as a --build-arg to the
  4. # Dockerfile; TAG and BASE_IMAGE can be overridden via the environment for
  5. # the fork comparison (TAG=dsv4-flash-vision-eugr:local and
  6. # TAG=dsv4-flash-vision-aiden:local from the same context).
  7. set -euo pipefail
  8. cd "$(dirname "$0")"
  9. TAG="${TAG:-dsv4-flash-vision:local}"
  10. ARGS=()
  11. while IFS= read -r line; do
  12. case "$line" in
  13. ''|\#*) continue ;;
  14. esac
  15. key="${line%%=*}"; val="${line#*=}"
  16. val="${val%\"}"; val="${val#\"}"
  17. [ -n "$key" ] && ARGS+=(--build-arg "${key}=${val}")
  18. done < versions.env
  19. [ -n "${BASE_IMAGE:-}" ] && ARGS+=(--build-arg "BASE_IMAGE=${BASE_IMAGE}")
  20. echo "=== Building ${TAG} ==="
  21. DOCKER_BUILDKIT=1 docker build "${ARGS[@]}" --progress=plain -t "${TAG}" -f Dockerfile . 2>&1
  22. echo "=== Done: ${TAG} ==="