浏览代码

fix: download

lushdog 5 月之前
父节点
当前提交
e6700f3fc8
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 4 5
      Dockerfile

+ 4 - 5
Dockerfile

@@ -4,6 +4,7 @@ WORKDIR /app
 
 RUN apt-get update && apt-get install -y \
     curl \
+    jq \
     && rm -rf /var/lib/apt/lists/*
 
 # 检测系统架构并下载对应的二进制文件
@@ -24,11 +25,9 @@ RUN ARCH=$(uname -m) && \
         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 "$BINARY_NAME\"" | \
-    cut -d '"' -f 4 | \
-    xargs -I {} curl -L -o nexus-network {} && \
+    DOWNLOAD_URL=$(curl -s https://api.github.com/repos/nexus-xyz/nexus-cli/releases/latest | \
+    jq -r ".assets[] | select(.name == \"$BINARY_NAME\") | .browser_download_url") && \
+    curl -L -o nexus-network "$DOWNLOAD_URL" && \
     chmod +x nexus-network
     
 COPY entrypoint.sh entrypoint.sh