|
|
@@ -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
|