build_image.sh 562 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. set -e
  3. if [ -z "$BT_APP" ]; then
  4. echo The enironment variable BT_APP must be set to the name of the crate to build.
  5. exit 1
  6. fi
  7. BASE_DEPENDS='openssl tpm2-tss'
  8. if [ btfsd = "$BT_APP" ]; then
  9. BT_DEPENDS="$BASE_DEPENDS"
  10. elif [ btprovision = "$BT_APP" ]; then
  11. BT_DEPENDS="$BASE_DEPENDS"
  12. elif [ btfuse = "$BT_APP" ]; then
  13. BT_DEPENDS="$BASE_DEPENDS fuse3"
  14. else
  15. echo Unrecognized BT_APP: $BT_APP
  16. exit 2
  17. fi
  18. sudo docker build -t $BT_APP:latest\
  19. --build-arg BT_APP=$BT_APP --build-arg BT_DEPENDS="$BT_DEPENDS"\
  20. -f Dockerfile ..