Procházet zdrojové kódy

fix: 修复docker在某些架构中无法正常运行的问题

sansan před 8 měsíci
rodič
revize
50b5b60b74
3 změnil soubory, kde provedl 43 přidání a 11 odebrání
  1. 31 5
      docker/Dockerfile
  2. 11 5
      readme.md
  3. 1 1
      version

+ 31 - 5
docker/Dockerfile

@@ -2,13 +2,39 @@ FROM python:3.10-slim
 
 WORKDIR /app
 
-# https://github.com/aptible/supercronic/releases
-ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.34/supercronic-linux-amd64 \
-    SUPERCRONIC_SHA1SUM=e8631edc1775000d119b70fd40339a7238eece14 \
-    SUPERCRONIC=supercronic-linux-amd64
+# https://github.com/aptible/supercronic
+ARG TARGETARCH
+ENV SUPERCRONIC_VERSION=v0.2.34
 
-RUN apt-get update && \
+RUN set -ex && \
+    apt-get update && \
     apt-get install -y --no-install-recommends curl && \
+    case ${TARGETARCH} in \
+        amd64) \
+            export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-amd64; \
+            export SUPERCRONIC_SHA1SUM=e8631edc1775000d119b70fd40339a7238eece14; \
+            export SUPERCRONIC=supercronic-linux-amd64; \
+            ;; \
+        arm64) \
+            export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-arm64; \
+            export SUPERCRONIC_SHA1SUM=4ab6343b52bf9da592e8b4bb7ae6eb5a8e21b71e; \
+            export SUPERCRONIC=supercronic-linux-arm64; \
+            ;; \
+        arm) \
+            export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-arm; \
+            export SUPERCRONIC_SHA1SUM=4ba4cd0da62082056b6def085fa9377d965fbe01; \
+            export SUPERCRONIC=supercronic-linux-arm; \
+            ;; \
+        386) \
+            export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-386; \
+            export SUPERCRONIC_SHA1SUM=80b4fff03a8d7bf2f24a1771f37640337855e949; \
+            export SUPERCRONIC=supercronic-linux-386; \
+            ;; \
+        *) \
+            echo "Unsupported architecture: ${TARGETARCH}"; \
+            exit 1; \
+            ;; \
+    esac && \
     curl -fsSLO "$SUPERCRONIC_URL" && \
     echo "${SUPERCRONIC_SHA1SUM}  ${SUPERCRONIC}" | sha1sum -c - && \
     chmod +x "$SUPERCRONIC" && \

+ 11 - 5
readme.md

@@ -7,7 +7,7 @@
 [![GitHub Stars](https://img.shields.io/github/stars/sansan0/TrendRadar?style=flat-square&logo=github&color=yellow)](https://github.com/sansan0/TrendRadar/stargazers)
 [![GitHub Forks](https://img.shields.io/github/forks/sansan0/TrendRadar?style=flat-square&logo=github&color=blue)](https://github.com/sansan0/TrendRadar/network/members)
 [![License](https://img.shields.io/badge/license-GPL--3.0-blue.svg?style=flat-square)](LICENSE)
-[![Version](https://img.shields.io/badge/version-v2.1.0-green.svg?style=flat-square)](https://github.com/sansan0/TrendRadar)
+[![Version](https://img.shields.io/badge/version-v2.1.1-green.svg?style=flat-square)](https://github.com/sansan0/TrendRadar)
 
 [![企业微信通知](https://img.shields.io/badge/企业微信-通知支持-00D4AA?style=flat-square)](https://work.weixin.qq.com/)
 [![Telegram通知](https://img.shields.io/badge/Telegram-通知支持-00D4AA?style=flat-square)](https://telegram.org/)
@@ -172,7 +172,6 @@ GitHub 一键 Fork 即可使用,无需编程基础。
 - **小版本更新**:一般情况,直接在 GitHub 网页编辑器中,用本项目的 `main.py` 代码替换你 fork 仓库中的对应文件 
 - **大版本升级**:从 v1.x 升级到 v2.0 建议删除现有 fork 后重新 fork,这样更省力且避免配置冲突
 
-### 2025/08/30 - v2.1.0
 
 > 感谢各位朋友的支持与厚爱,特别感谢:
 > 
@@ -184,6 +183,16 @@ GitHub 一键 Fork 即可使用,无需编程基础。
 > 
 > 下一次**新功能**,大概会是 ai 分析功能(大概(●'◡'●)
 
+### 2025/09/04 - v2.1.1
+
+- 修复docker在某些架构中无法正常运行的问题
+
+
+<details>
+<summary><strong>👉 历史更新</strong></summary>
+
+### 2025/08/30 - v2.1.0
+
 **核心改进**:
 - **推送逻辑优化**:从"每次执行都推送"改为"时间窗口内可控推送"
 - **时间窗口控制**:可设定推送时间范围,避免非工作时间打扰
@@ -193,9 +202,6 @@ GitHub 一键 Fork 即可使用,无需编程基础。
 - 本功能默认关闭,需手动在 config.yaml 中开启静默推送模式
 - 升级需同时更新 main.py 和 config.yaml 两个文件
 
-<details>
-<summary><strong>👉 历史更新</strong></summary>
-
 ### 2025/08/27 - v2.0.4
 
 - 本次版本不是功能修复,而是重要提醒

+ 1 - 1
version

@@ -1 +1 @@
-2.1.0
+2.1.1