rust
Rust Overview
Secure your stack with a hardened Rust image freshly-built by Minimus. Minimus images always include the most up-to-date package version for all packages and dependencies contained in the image.
Use the Rust container image built by Minimus to build, run, or distribute applications written in the Rust programming language. This image includes the complete Rust toolchain with cargo, clippy, rustfmt, and rustdoc for building reliable and efficient software.
Try It Out
To take the Minimus Rust image for a test run. The following command will compile and run a simple Rust program:
docker run -it --rm \
reg.mini.dev/rust \
sh -c 'echo "fn main() { println!(\"Hello from Rust!\"); }" > hello.rs && rustc hello.rs && ./hello'You should get a response similar to this:
Hello from Rust!Create and run a new Cargo project:
docker run -it --rm \
reg.mini.dev/rust \
sh -c 'cargo new hello_cargo --bin && cd hello_cargo && cargo run'Ready to work on your own Rust project?
You can mount your source code and build it inside the container. Navigate to your Rust project directory and run:
docker run -it --rm \
-v $(pwd):/usr/src/app \
-w /usr/src/app \
reg.mini.dev/rust \
cargo build --releaseFor interactive development:
docker run -it --rm \
-v $(pwd):/usr/src/app \
-w /usr/src/app \
reg.mini.dev/rust \
shTechnical Considerations
The Rust image provided by Minimus is a slim, security-hardened alternative to the public image from Docker Hub. The images are largely interchangeable, with a few differences as noted below.
Rust built by Minimus:
- Runs as non-root by default for a security-first approach that protects against privilege escalation attacks. The public image runs as root.
- Includes the complete toolchain: rustc, cargo, clippy, rustfmt, and rustdoc.
- Working directory is set to
/usr/src/appwith proper permissions for the rust user. - Environment variables pre-configured:
CARGO_HOME=/usr/local/cargoandRUSTUP_HOME=/usr/local/rustup. - Drill down on the version specification tab to see the default user, listening ports, entrypoint, volumes, environment variables, etc.
The Payoff
A hardened, minimal image that will remain more secure for the long run and accrue vulnerabilities at a slower rate.
- See the risk reduction dashboard for a detailed CVE comparison over the past 30 days.
- Review the compliance report to see the default hardening and security configurations for the image.
Terms & Info
Trademark
This catalog is published by Minimus. All product names, logos, and marks, other than those belonging to Minimus, shown are owned by their respective rights holders and appear here only to identify the open source software each image contains. Minimus claims no ownership of those marks and implies no affiliation with, endorsement by, certification by, or sponsorship by any rights holder.
Disclaimer
Images are provided "as-is" without warranty of any kind. "Hardened" refers to the security configuration applied at the time of build and does not constitute a guarantee of ongoing security or absence of vulnerabilities. The free tier is provided without support, SLA, or guaranteed patching timelines. Security updates may be applied to paid subscriptions before or instead of free tier images. By pulling or using any image you agree to our Terms of Use.