From 02b17a03cb7a2b27a9d67f976dff8d664cbf0c20 Mon Sep 17 00:00:00 2001 From: Eli Mallon Date: Sat, 4 Jul 2026 14:51:14 -0700 Subject: [PATCH] docker: retry mistserver download, extract from a complete file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mistserver image build piped `curl … | tar xzv` straight from r.mistserver.org, so any transient hiccup (it has been 502ing) either fed a truncated stream to tar or failed outright with no retry — flaking CI's "mistserver image" job repeatedly. Download to a file with retries (`-f --retry 12 --retry-all-errors --retry-delay 10 --retry-max-time 240`) and only extract once the transfer completes. Applied to both the ghcr and compose Dockerfiles. Co-Authored-By: Claude Opus 4.8 --- docker/mistserver.Dockerfile | 8 +++++++- docker/mistserver.ghcr.Dockerfile | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docker/mistserver.Dockerfile b/docker/mistserver.Dockerfile index 38a39584a..ddb112b7e 100644 --- a/docker/mistserver.Dockerfile +++ b/docker/mistserver.Dockerfile @@ -7,7 +7,13 @@ ENV STREAMPLACE_URL $STREAMPLACE_URL RUN export LOCAL_URL="$(echo $STREAMPLACE_URL | sed 's/-cloudflare//')" && echo "downloading $LOCAL_URL" && cd /usr/local/bin && curl -L "$LOCAL_URL" | tar xzv RUN apt-get update && apt-get install -y curl -RUN cd /usr/bin && curl -o - https://r.mistserver.org/dl/mistserver_64V3.7.tar.gz | tar xzv +# Download to a file with retries, then extract (see mistserver.ghcr.Dockerfile): +# piping curl into tar corrupts extraction on a truncated transfer, and +# r.mistserver.org hiccups intermittently. +RUN cd /usr/bin && \ + curl -fL --retry 12 --retry-all-errors --retry-delay 10 --retry-max-time 240 -o /tmp/mistserver.tar.gz https://r.mistserver.org/dl/mistserver_64V3.7.tar.gz && \ + tar xzvf /tmp/mistserver.tar.gz && \ + rm /tmp/mistserver.tar.gz RUN mkdir -p /config ADD ./docker/mistserver.json /config/mistserver.json CMD ["MistController", "-c", "/config/mistserver.json"] diff --git a/docker/mistserver.ghcr.Dockerfile b/docker/mistserver.ghcr.Dockerfile index 3e5e2b2ab..6c68a782d 100644 --- a/docker/mistserver.ghcr.Dockerfile +++ b/docker/mistserver.ghcr.Dockerfile @@ -6,7 +6,14 @@ FROM --platform=linux/amd64 ubuntu:24.04 RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/* COPY build-linux-amd64/streamplace /usr/local/bin/streamplace RUN chmod +x /usr/local/bin/streamplace -RUN cd /usr/bin && curl -L -o - https://r.mistserver.org/dl/mistserver_64V3.7.tar.gz | tar xzv +# Download to a file with retries, then extract. Piping curl straight into tar +# corrupts the extraction when the transfer is truncated, and r.mistserver.org +# hiccups intermittently (flaked CI repeatedly), so retry transient failures and +# only untar a complete download. +RUN cd /usr/bin && \ + curl -fL --retry 12 --retry-all-errors --retry-delay 10 --retry-max-time 240 -o /tmp/mistserver.tar.gz https://r.mistserver.org/dl/mistserver_64V3.7.tar.gz && \ + tar xzvf /tmp/mistserver.tar.gz && \ + rm /tmp/mistserver.tar.gz RUN mkdir -p /config ADD mistserver.json /config/mistserver.json CMD ["MistController", "-c", "/config/mistserver.json"] -- 2.51.2