mirror of
https://github.com/dockersrc/rust
synced 2026-06-24 14:01:04 -04:00
e36a6888dd
Install latest stable Rust at build time via rustup-init with SHA256 verification. Add 30 cross-compile targets, cargo-binstall, and a comprehensive set of cargo development tools. Match the official rust:alpine env-var convention (RUSTUP_HOME / CARGO_HOME) and declare those paths as Docker VOLUMEs. Add the Go-image pattern: rust-workflow runs automatically when the container is invoked with no args, while explicit commands pass through unchanged. Copy language-agnostic healthcheck, copy, and symlink utilities from the Go image. - Dockerfile: WORKDIR /app in final stage; add RUSTUP_HOME, CARGO_HOME, RUSTUP_TOOLCHAIN ENV vars; extend VOLUME to include cargo and rustup paths - rootfs/root/docker/setup/05-custom.sh: full Rust toolchain install — build deps (build-base musl-dev clang lld cmake openssl-dev), SHA256- verified rustup-init, stable toolchain with rust-src/rust-analyzer/ llvm-tools-preview, 30 cross-compile targets, cargo-binstall bootstrap, cargo tool suite via binstall, cross-linker config.toml, /usr/local/bin symlinks, ~/.cargo and ~/.rustup home symlinks, /etc/profile.d/rust.sh - rootfs/usr/local/bin/rust-workflow: default workflow script — fmt --check → clippy -D warnings → test --all → build --release; honours CARGO_WORKDIR and CARGO_BUILD_TARGET env vars - rootfs/usr/local/bin/entrypoint.sh: __no_exit guarded by $# -eq 0 in START_SERVICES block; * catch-all now calls rust-workflow on no args - rootfs/usr/local/bin/healthcheck: copied from Go image (HTTP/TCP/ process/file health probe) - rootfs/usr/local/bin/copy: copied from Go image (recursive copy utility) - rootfs/usr/local/bin/symlink: copied from Go image (symlink utility) Dockerfile rootfs/root/docker/setup/05-custom.sh rootfs/usr/local/bin/copy rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/bin/healthcheck rootfs/usr/local/bin/rust-workflow rootfs/usr/local/bin/symlink