prepare_rc_images.sh 632 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env bash
  2. pip_index_url=''
  3. while getopts 'p:' opt; do
  4. case "$opt" in
  5. p) pip_index_url="$OPTARG" ;;
  6. *) echo "Usage: $0 [-p pip_index_url]" >&2; exit 2 ;;
  7. esac
  8. done
  9. shift "$((OPTIND-1))"
  10. for device_type in 'gpu' 'cpu'; do
  11. args=(
  12. -f Dockerfile
  13. -t "paddlex-hps-rc:${device_type}"
  14. --target 'rc'
  15. --build-arg DEVICE_TYPE="${device_type}"
  16. --build-arg http_proxy="${http_proxy}"
  17. --build-arg https_proxy="${https_proxy}"
  18. )
  19. [[ -n "$pip_index_url" ]] && args+=( --build-arg PIP_INDEX_URL="${pip_index_url}" )
  20. DOCKER_BUILDKIT=1 docker build "${args[@]}" .
  21. done