What does it do?#
Runs the Rust toolchain — Cargo, rustfmt and Clippy — inside Docker containers, no local Rust install required. Like the Images and AI Tools aliases, this file is not sourced automatically — you need to add it explicitly.
Enabling it#
Bash / zsh#
source ~/.docker-devtools/docker-devtools.sh
source ~/.docker-devtools/rust/docker-rust-devtools.shPowerShell#
. "$HOME/.docker-devtools/docker-devtools.ps1"
. "$HOME/.docker-devtools/rust/docker-rust-devtools.ps1"Source the root script first —
docker_alias/Invoke-DockerAliasmust already be defined before this file loads.
Commands#
Commands you can run to use this.
Aliases#
| Alias | Tool | Image |
|---|---|---|
cargo-docker | Cargo — build tool & package manager | rust:alpine |
rust-bash-docker | Interactive shell in Rust container | rust:alpine |
rustfmt-docker | rustfmt — Rust code formatter (ships with the official image) | rust:alpine |
clippy-docker | Clippy — Rust linter (ships with the official image) | rust:alpine |
Usage#
# Build and test
cargo-docker build
cargo-docker test
# Format and lint
rustfmt-docker src/main.rs
clippy-dockerThe Sources#
GitHub: https://github.com/willhallonline/docker-devtools-aliases