Does this need an update? Let me know.
Build
docker build -t rust .
Shell
As a shell with rustc and cargo installed:
docker run -t -i --rm=true -v $(pwd):/source hoverbear/rust /bin/bash
Rustc
To compile a rust file:
docker run -t -i --rm=true -v $(pwd):/source hoverbear/rust rustc myfile.rs
Cargo
To build a cargo project:
docker run -t -i --rm=true -v $(pwd):/source hoverbear/rust cargo build
SELinux Issues
On SELinux flavors you might need to set permissions properly.
chcon -Rt svirt_sandbox_file_t $(pwd)