mirror of
https://gitee.com/houhuan/TrendRadar.git
synced 2026-05-01 01:02:41 +08:00
v3.5.0: 新增了一些功能,详细见【更新日志】
This commit is contained in:
+18
-19
@@ -2,9 +2,9 @@ FROM python:3.10-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# https://github.com/aptible/supercronic
|
||||
# Latest releases available at https://github.com/aptible/supercronic/releases
|
||||
ARG TARGETARCH
|
||||
ENV SUPERCRONIC_VERSION=v0.2.34
|
||||
ENV SUPERCRONIC_VERSION=v0.2.39
|
||||
|
||||
RUN set -ex && \
|
||||
apt-get update && \
|
||||
@@ -12,12 +12,12 @@ RUN set -ex && \
|
||||
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_SHA1SUM=c98bbf82c5f648aaac8708c182cc83046fe48423; \
|
||||
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_SHA1SUM=5ef4ccc3d43f12d0f6c3763758bc37cc4e5af76e; \
|
||||
export SUPERCRONIC=supercronic-linux-arm64; \
|
||||
;; \
|
||||
*) \
|
||||
@@ -26,26 +26,25 @@ RUN set -ex && \
|
||||
;; \
|
||||
esac && \
|
||||
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; \
|
||||
# 重试机制:最多3次,每次超时30秒
|
||||
for i in 1 2 3; do \
|
||||
echo "Download attempt $i/3"; \
|
||||
if curl -fsSL --connect-timeout 30 --max-time 60 -o "$SUPERCRONIC" "$SUPERCRONIC_URL"; then \
|
||||
echo "Download successful"; \
|
||||
break; \
|
||||
else \
|
||||
echo "Download attempt $i failed"; \
|
||||
if [ $i -eq 3 ]; then \
|
||||
echo "All download attempts failed"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
sleep 2; \
|
||||
fi; \
|
||||
done && \
|
||||
echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
|
||||
chmod +x "$SUPERCRONIC" && \
|
||||
mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
|
||||
ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
|
||||
# 验证安装
|
||||
supercronic -version && \
|
||||
apt-get remove -y curl && \
|
||||
apt-get clean && \
|
||||
|
||||
Reference in New Issue
Block a user