mirror of
https://gitee.com/houhuan/TrendRadar.git
synced 2025-12-21 15:57:16 +08:00
fix: 修复Docker构建网络连接问题
This commit is contained in:
parent
89ab87cad2
commit
10784f0ec5
7
.github/workflows/docker.yml
vendored
7
.github/workflows/docker.yml
vendored
@ -21,6 +21,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
driver-opts: |
|
||||||
|
network=host
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
@ -41,6 +44,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v5
|
||||||
|
env:
|
||||||
|
BUILDKIT_PROGRESS: plain
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
@ -50,3 +55,5 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
build-args: |
|
||||||
|
BUILDKIT_INLINE_CACHE=1
|
||||||
|
|||||||
@ -8,7 +8,7 @@ ENV SUPERCRONIC_VERSION=v0.2.34
|
|||||||
|
|
||||||
RUN set -ex && \
|
RUN set -ex && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y --no-install-recommends curl && \
|
apt-get install -y --no-install-recommends curl ca-certificates && \
|
||||||
case ${TARGETARCH} in \
|
case ${TARGETARCH} in \
|
||||||
amd64) \
|
amd64) \
|
||||||
export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-amd64; \
|
export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-amd64; \
|
||||||
@ -35,11 +35,28 @@ RUN set -ex && \
|
|||||||
exit 1; \
|
exit 1; \
|
||||||
;; \
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
curl -fsSLO "$SUPERCRONIC_URL" && \
|
echo "Downloading supercronic for ${TARGETARCH} from ${SUPERCRONIC_URL}" && \
|
||||||
|
# 添加重试机制和超时设置
|
||||||
|
for i in 1 2 3 4 5; do \
|
||||||
|
echo "Download attempt $i/5"; \
|
||||||
|
if curl --fail --silent --show-error --location --retry 3 --retry-delay 2 --connect-timeout 30 --max-time 120 -o "$SUPERCRONIC" "$SUPERCRONIC_URL"; then \
|
||||||
|
echo "Download successful"; \
|
||||||
|
break; \
|
||||||
|
else \
|
||||||
|
echo "Download attempt $i failed, exit code: $?"; \
|
||||||
|
if [ $i -eq 5 ]; then \
|
||||||
|
echo "All download attempts failed"; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
|
sleep $((i * 2)); \
|
||||||
|
fi; \
|
||||||
|
done && \
|
||||||
echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
|
echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
|
||||||
chmod +x "$SUPERCRONIC" && \
|
chmod +x "$SUPERCRONIC" && \
|
||||||
mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
|
mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
|
||||||
ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
|
ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
|
||||||
|
# 验证安装
|
||||||
|
supercronic -version && \
|
||||||
apt-get remove -y curl && \
|
apt-get remove -y curl && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
2
main.py
2
main.py
@ -20,7 +20,7 @@ import requests
|
|||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
VERSION = "2.3.0"
|
VERSION = "2.3.1"
|
||||||
|
|
||||||
|
|
||||||
# === SMTP邮件配置 ===
|
# === SMTP邮件配置 ===
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
[](https://github.com/sansan0/TrendRadar/stargazers)
|
[](https://github.com/sansan0/TrendRadar/stargazers)
|
||||||
[](https://github.com/sansan0/TrendRadar/network/members)
|
[](https://github.com/sansan0/TrendRadar/network/members)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://github.com/sansan0/TrendRadar)
|
[](https://github.com/sansan0/TrendRadar)
|
||||||
|
|
||||||
[](https://work.weixin.qq.com/)
|
[](https://work.weixin.qq.com/)
|
||||||
[](https://telegram.org/)
|
[](https://telegram.org/)
|
||||||
@ -296,7 +296,7 @@ GitHub 一键 Fork 即可使用,无需编程基础。
|
|||||||
>
|
>
|
||||||
> 下一次**新功能**,大概会是 ai 分析功能(●'◡'●)
|
> 下一次**新功能**,大概会是 ai 分析功能(●'◡'●)
|
||||||
|
|
||||||
### 2025/09/22 - v2.3.0
|
### 2025/09/22 - v2.3.1
|
||||||
|
|
||||||
- **新增邮件推送功能**,支持将热点新闻报告发送到邮箱
|
- **新增邮件推送功能**,支持将热点新闻报告发送到邮箱
|
||||||
- **智能 SMTP 识别**:自动识别 Gmail、QQ邮箱、Outlook、网易邮箱等 10+ 种邮箱服务商配置
|
- **智能 SMTP 识别**:自动识别 Gmail、QQ邮箱、Outlook、网易邮箱等 10+ 种邮箱服务商配置
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user