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.sh

PowerShell#

. "$HOME/.docker-devtools/docker-devtools.ps1"
. "$HOME/.docker-devtools/rust/docker-rust-devtools.ps1"

Source the root script first — docker_alias / Invoke-DockerAlias must already be defined before this file loads.

Commands#

Commands you can run to use this.

Aliases#

AliasToolImage
cargo-dockerCargo — build tool & package managerrust:alpine
rust-bash-dockerInteractive shell in Rust containerrust:alpine
rustfmt-dockerrustfmt — Rust code formatter (ships with the official image)rust:alpine
clippy-dockerClippy — 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-docker

The Sources#

GitHub: https://github.com/willhallonline/docker-devtools-aliases

Find out more#