Files
zed/crates/eval_cli/Dockerfile
T
tidely 3a5180211a Bump Rust to version 1.100 (#67115)
## Summary

Bumps Rust to version 1.100 which has some fantastic goodies.

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A
- [GPUI] N/A
2026-11-23 12:06:38 +00:00

53 lines
2.0 KiB
Docker

# Build eval-cli for Linux.
#
# Usage (from the zed repo root):
# docker build --platform linux/amd64 -f crates/eval_cli/Dockerfile -t eval-cli-builder .
# docker cp "$(docker create eval-cli-builder)":/eval-cli ./target/eval-cli
#
# Or use the helper script:
# crates/eval_cli/script/build-linux
FROM rust:1.100.0@sha256:223cc32ddca8f3ee90c436dbc94b6b5f052ea7f9653c5201e9612f08ad7d21b8 AS builder
ARG CARGO_ZIGBUILD_VERSION=0.22.3
WORKDIR /app
# Pre-install the toolchain specified in rust-toolchain.toml so it is cached.
RUN rustup toolchain install 1.100.0 --profile minimal \
--component rustfmt --component clippy --component rust-analyzer --component rust-src \
--target wasm32-wasip2 --target wasm32-unknown-unknown --target x86_64-unknown-linux-musl --target x86_64-unknown-linux-gnu
# Install build tools. cmake + build-essential are needed for vendored C
# libraries (libgit2-sys, zstd-sys, libsqlite3-sys). No audio/GUI -dev
# packages required — eval-cli runs headless with those features disabled.
#
# cargo-zigbuild cross-compiles against musl libc, producing a fully
# static binary that runs on any Linux distro (glibc or musl / Alpine).
RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
build-essential \
curl \
xz-utils \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /opt/zig \
&& curl -fsSL https://ziglang.org/download/0.15.2/zig-x86_64-linux-0.15.2.tar.xz \
| tar -xJ -C /opt/zig --strip-components=1 \
&& ln -s /opt/zig/zig /usr/local/bin/zig
RUN cargo install --locked cargo-zigbuild --version ${CARGO_ZIGBUILD_VERSION}
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/app/target \
cargo zigbuild --release --package eval_cli \
--target x86_64-unknown-linux-musl && \
cp /app/target/x86_64-unknown-linux-musl/release/eval-cli /eval-cli && \
strip /eval-cli
FROM scratch
COPY --from=builder /eval-cli /eval-cli