Răsfoiți Sursa

feat: macos

lushdog 6 luni în urmă
părinte
comite
a0e463a770
2 a modificat fișierele cu 32 adăugiri și 2 ștergeri
  1. 20 2
      Dockerfile
  2. 12 0
      README.md

+ 20 - 2
Dockerfile

@@ -6,9 +6,27 @@ RUN apt-get update && apt-get install -y \
     curl screen \
     && rm -rf /var/lib/apt/lists/*
 
-RUN curl -s https://api.github.com/repos/nexus-xyz/nexus-cli/releases/latest | \
+# 检测系统架构并下载对应的二进制文件
+RUN ARCH=$(uname -m) && \
+    if [ "$ARCH" = "x86_64" ]; then \
+        if [ "$(uname -s)" = "Darwin" ]; then \
+            BINARY_NAME="nexus-network-macos-x86_64"; \
+        else \
+            BINARY_NAME="nexus-network-linux-x86_64"; \
+        fi; \
+    elif [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
+        if [ "$(uname -s)" = "Darwin" ]; then \
+            BINARY_NAME="nexus-network-macos-arm64"; \
+        else \
+            BINARY_NAME="nexus-network-linux-arm64"; \
+        fi; \
+    else \
+        echo "Unsupported architecture: $ARCH" && exit 1; \
+    fi && \
+    echo "Downloading $BINARY_NAME for architecture $ARCH" && \
+    curl -s https://api.github.com/repos/nexus-xyz/nexus-cli/releases/latest | \
     grep "browser_download_url" | \
-    grep "nexus-network-linux-x86_64\"" | \
+    grep "$BINARY_NAME\"" | \
     cut -d '"' -f 4 | \
     xargs -I {} curl -L -o nexus-network {} && \
     chmod +x nexus-network

+ 12 - 0
README.md

@@ -30,3 +30,15 @@ docker compose exec nexus-network screen -r nexus
 ```bash
 ctrl+A D
 ```
+
+## MacOS
+
+本地 build
+```bash
+bash build.sh
+```
+
+运行
+```bash
+docker compose up -d
+```