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

This commit is contained in:
sansan
2025-09-04 13:25:20 +08:00
parent 3c604b0699
commit 50b5b60b74
3 changed files with 43 additions and 11 deletions
+31 -5
View File
@@ -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" && \