From 3794f4cf365f9105cc33bb3cb0ff693f835628a0 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Mar 2026 10:42:46 +0000 Subject: [PATCH] Fix Dockerfile heredoc parse error in RUN if block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use printf instead of heredoc for cargo config — heredoc inside a conditional RUN block confuses Docker's parser (fi becomes an unknown instruction). The config is always written; unused linker entries are harmless on native builds. --- infra/Dockerfile.server | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/infra/Dockerfile.server b/infra/Dockerfile.server index f6239b9..b3a1161 100644 --- a/infra/Dockerfile.server +++ b/infra/Dockerfile.server @@ -29,19 +29,16 @@ RUN case "${TARGETARCH}:${TARGETVARIANT}" in \ esac > /rust_target && \ rustup target add "$(cat /rust_target)" -# Tell Cargo which cross-linker to use — only needed when cross-compiling. -RUN if [ "${BUILDPLATFORM}" != "${TARGETPLATFORM}" ]; then \ - mkdir -p /root/.cargo && cat >> /root/.cargo/config.toml <<'EOF' -[target.aarch64-unknown-linux-gnu] -linker = "aarch64-linux-gnu-gcc" - -[target.armv7-unknown-linux-gnueabihf] -linker = "arm-linux-gnueabihf-gcc" - -[target.arm-unknown-linux-gnueabi] -linker = "arm-linux-gnueabi-gcc" -EOF - fi +# Tell Cargo which cross-linker to use (ignored on native builds). +RUN mkdir -p /root/.cargo && printf '\ +[target.aarch64-unknown-linux-gnu]\n\ +linker = "aarch64-linux-gnu-gcc"\n\ +\n\ +[target.armv7-unknown-linux-gnueabihf]\n\ +linker = "arm-linux-gnueabihf-gcc"\n\ +\n\ +[target.arm-unknown-linux-gnueabi]\n\ +linker = "arm-linux-gnueabi-gcc"\n' >> /root/.cargo/config.toml WORKDIR /build