#!/usr/bin/env bash # Runs a command inside the reference Rust builder image with the repository mounted # at /w: the reproducible alternative to the native toolchain of the development machine # (docs/development/RUST.md ยง1). Cargo's registry and the target directory live in named # Docker volumes (faunosteo_ prefix, DEPLOY.md "Docker resource naming"), separate from # the native ./target, so incremental builds stay fast across runs. # # bash docker/rust-run.sh cargo test --workspace # bash docker/rust-run.sh bash scripts/wasm-build.sh # = pnpm wasm:build:docker set -euo pipefail IMAGE="${FAUNOSTEO_RUST_BUILDER:-faunosteo_rust_builder:1.99.0}" ROOT="$(cd "$(dirname "$0")/.." && pwd)" TTY_FLAG=() if [ -t 0 ] && [ -t 1 ]; then TTY_FLAG=(-t) fi exec docker run --rm -i "${TTY_FLAG[@]}" \ -v "$ROOT":/w \ -v faunosteo_cargo_registry:/usr/local/cargo/registry \ -v faunosteo_rust_target:/w/target \ -w /w \ "$IMAGE" "$@"