Visual Studio Code, rebuilt in Rust
Rust
# Linux build and test image for VSRustium (port/tools/linux-build runs it on the Mac Studio, linux/arm64).
# Packages: GPUI's Linux platform (wu script/linux: xkbcommon, wayland, x11/xcb, fontconfig, freetype, vulkan, alsa),
# WebKitGTK 4.1 and libsecret for the webview and secrets, Xvfb and Mesa's Vulkan driver to run the app headless,
# squashfs-tools for port/tools/package-linux's AppImage, ripgrep for the output filters of commands run here.
FROM node:24-trixie-slim AS node
FROM oven/bun:1.4.5-debian AS bun
FROM rust:1-trixie
RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config clang \
libasound2-dev libfontconfig-dev libfreetype-dev libwayland-dev libx11-xcb-dev libxcb1-dev libxkbcommon-x11-dev \
libvulkan1 mesa-vulkan-drivers libssl-dev libzstd-dev libdbus-1-dev \
libwebkit2gtk-4.1-dev libsecret-1-dev \
xvfb xauth git file squashfs-tools ripgrep \
&& rm -rf /var/lib/apt/lists/*
COPY --from=node /usr/local/bin/node /usr/local/bin/node
# npm installs node-gyp for port/tools/package-linux's native module rebuilds.
COPY --from=node /usr/local/lib/node_modules/npm /usr/local/lib/node_modules/npm
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
COPY --from=bun /usr/local/bin/bun /usr/local/bin/bun
# cargo-gc, so builds run as `cargo gc <cmd>` here too and the target volume stays bounded.
RUN arch=$(uname -m) \
&& case $arch in \
aarch64) sum=4b7e766d5e603efb5bfa274ba4c5f67b3b9b531c48930899b173930fe349178c ;; \
x86_64) sum=d9c54f01095e39195173db70d97e792545a8d4745d30e80aabde33f2aa486601 ;; \
esac \
&& curl -fsSL -o /tmp/cargo-gc.tgz "https://github.com/leostera/cargo-gc/releases/download/v0.2/cargo-gc-v0.2-$arch-unknown-linux-gnu.tar.gz" \
&& echo "$sum /tmp/cargo-gc.tgz" | sha256sum -c - \
&& tar xzf /tmp/cargo-gc.tgz -C /usr/local/cargo/bin ./cargo-gc \
&& rm /tmp/cargo-gc.tgz
# Zig builds libghostty-vt (libghostty-vt-sys's build.rs).
RUN arch=$(uname -m) \
&& case $arch in \
aarch64) sum=a1546d5646eb184437918d6635ca6b762a0e889eac09cef720ee7a1ed3fe7795 ;; \
x86_64) sum=3581863e3cbcfd0fce0efc682ce7e9e93da96668a977791d356a26d2a7e9b17a ;; \
esac \
&& curl -fsSL -o /tmp/zig.tar.xz "https://ziglang.org/download/0.17.1/zig-$arch-linux-0.17.1.tar.xz" \
&& echo "$sum /tmp/zig.tar.xz" | sha256sum -c - \
&& tar xJf /tmp/zig.tar.xz -C /opt \
&& ln -s /opt/zig-$arch-linux-0.17.1/zig /usr/local/bin/zig \
&& rm /tmp/zig.tar.xz