diff --git a/Dockerfile b/Dockerfile index d6aa98385..744909a18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,6 +23,7 @@ RUN case "$TARGETPLATFORM" in \ "linux/amd64") echo "x86_64-unknown-linux-musl" > rust_target.txt ;; \ *) exit 1 ;; \ esac + # Update rustup whenever we bump the rust version COPY rust-toolchain.toml rust-toolchain.toml RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --target $(cat rust_target.txt) --profile minimal --default-toolchain none @@ -34,7 +35,10 @@ RUN rustup target add $(cat rust_target.txt) COPY crates crates COPY ./Cargo.toml Cargo.toml COPY ./Cargo.lock Cargo.lock -RUN cargo zigbuild --bin uv --bin uvx --target $(cat rust_target.txt) --release +RUN case "${TARGETPLATFORM}" in \ + "linux/arm64") export JEMALLOC_SYS_WITH_LG_PAGE=16;; \ + esac && \ + cargo zigbuild --bin uv --bin uvx --target $(cat rust_target.txt) --release RUN cp target/$(cat rust_target.txt)/release/uv /uv \ && cp target/$(cat rust_target.txt)/release/uvx /uvx # TODO(konsti): Optimize binary size, with a version that also works when cross compiling