DockerInit.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. case $1 in
  3. amd64)
  4. ARCH="64"
  5. FNAME="amd64"
  6. ;;
  7. i386)
  8. ARCH="32"
  9. FNAME="i386"
  10. ;;
  11. armv8 | arm64 | aarch64)
  12. ARCH="arm64-v8a"
  13. FNAME="arm64"
  14. ;;
  15. armv7 | arm | arm32)
  16. ARCH="arm32-v7a"
  17. FNAME="arm32"
  18. ;;
  19. armv6)
  20. ARCH="arm32-v6"
  21. FNAME="armv6"
  22. ;;
  23. *)
  24. ARCH="64"
  25. FNAME="amd64"
  26. ;;
  27. esac
  28. MTG_MULTI_VER="v1.11.0"
  29. mkdir -p build/bin
  30. cd build/bin
  31. curl -sfLRO "https://github.com/XTLS/Xray-core/releases/download/v26.6.27/Xray-linux-${ARCH}.zip"
  32. unzip "Xray-linux-${ARCH}.zip"
  33. rm -f "Xray-linux-${ARCH}.zip" geoip.dat geosite.dat
  34. mv xray "xray-linux-${FNAME}"
  35. # mtg-multi (MTProto sidecar) is pure Go, so build it from source for the target
  36. # arch — its release binaries only cover linux/darwin amd64/arm64.
  37. CGO_ENABLED=0 GOBIN="$(pwd)" go install -trimpath -ldflags "-s -w" "github.com/dolonet/mtg-multi@${MTG_MULTI_VER}"
  38. mv mtg-multi "mtg-linux-${FNAME}"
  39. chmod +x "mtg-linux-${FNAME}"
  40. curl -sfLRO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat
  41. curl -sfLRO https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat
  42. curl -sfLRo geoip_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geoip.dat
  43. curl -sfLRo geosite_IR.dat https://github.com/chocolate4u/Iran-v2ray-rules/releases/latest/download/geosite.dat
  44. curl -sfLRo geoip_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geoip.dat
  45. curl -sfLRo geosite_RU.dat https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/geosite.dat
  46. cd ../../