Originated in rust-lang/docker-rust#37
rustfmt and clippy components are widely used tools by many projects. However, there is some friction with using them on CI and dockerized environments:
rustup add component rustfmt any time we're using Docker image for that purpose. On CIs it just unnecessarily increases network activity. In CLI usage it becomes trickier as docker run --rm -v "$(pwd)":/app -w /app rust:1.31 cargo fmt just fails.rustfmt/clippy on nightly.The motivation of official Rust Docker images is to follow upstream tools as mush as possible without providing difference with official installations. As the result, these issues make people to workaround/hack or come up with their own Docker images.
Can we somehow provide a smoother experience?
I'm currently implementing 'profiles' for Rustup which will include tools, the default profile will include Rustfmt and Clippy.
Profiles were released with 1.20, this is "done"
@kinnison Can you add where we can find it ? I don't find any information on the README. Thanks
@Stargateur the README for Rustup clearly states the content of the default profile includes rustfmt and clippy -- https://github.com/rust-lang/rustup/#profiles
@kinnison Maybe I miss understand, the issue is about docker, so my question was where this information is on docker readme, I'm using "rust:latest" as image and I would like to know if this include fmt, that seem to not be the case.
My question more simply is there a official docker image with rustfmt installed ?
Oh I'm sorry, I didn't realise -- rustup has nothing to do with the rust:latest docker per-se, sorry. Whoever provides that would need to help you out. I'm afraid I have no clue who that is. I've asked on the infrastructure channel but they've not answered me yet. You'd be best off investigating who owns that dockerhub release and talking with them, sorry.
Most helpful comment
I'm currently implementing 'profiles' for Rustup which will include tools, the default profile will include Rustfmt and Clippy.