docker-multirust provides a clean install of Ubuntu with multirust installed.
multirust is a great way to manage multiple rust toolchains and switch between
them as needed. You should really be using it. The image comes with all the
toolchains with the default set to stable.
docker pull ryandq/multirust
Create a shell with the following command:
docker run -it ryandq/multirust
You can create a new image from this one in a Dockerfile by starting with
FROM ryandq/multirust RUN cargo new --bin hello-world RUN cd hello-world && cargo test