Run Rust tests, code checks, dependency audits, and cached builds in CI.
94
Run Rust tests, code checks, dependency audits, and cached builds in CI.
This image extends the current stable Rust toolchain with CI tools:
cargo-audit to check dependencies.pkg-config.The default working directory is /workspace. The default command is Bash.
| Tag | Contents | Platform |
|---|---|---|
latest | Latest successful build from main | linux/amd64 |
The latest tag changes after a new build passes its tests.
See all tags and digests.
docker pull stden/rust-ci:latest
docker run --rm -v "$PWD":/workspace stden/rust-ci:latest \
bash -c 'cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo nextest run'
docker run --rm -v "$PWD":/workspace stden/rust-ci:latest cargo audit
Run these commands from a project directory that contains Cargo.toml.
cargo audit checks Cargo.lock and needs access to the advisory database.
Cargo downloads your project dependencies when needed. The image does not contain them.
Use a named volume to keep the compiler cache between runs:
docker run --rm -v "$PWD":/workspace -v rust-ci-cache:/cache \
-e RUSTC_WRAPPER=sccache -e SCCACHE_DIR=/cache -e CARGO_INCREMENTAL=0 \
stden/rust-ci:latest cargo build --release
Build output stays in the mounted project directory. Files created by the container belong to root. LLD and mold are installed. Configure your project to select a linker if needed.
The smoke test runs Nextest, rustfmt, Clippy, and a real compiler cache check.
It checks LLVM tools and compiles programs with LLD and mold.
It checks the cargo-audit command without downloading an advisory database.
Content type
Image
Digest
sha256:c9ef79e87…
Size
866.8 MB
Last updated
4 days ago
docker pull stden/rust-ci