I want to have a docker image with the rustfmt. But I don't want the whole rust tooling to have smaller image.
I tried (the same approach worked for gofmt)
COPY --from=rust:1.65 /usr/local/cargo/bin/rustfmt /usr/bin/rustfmt
but that didn't work with error:
error: rustup could not choose a version of rustfmt to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
How can I handle this?