Sign inSign up

grummfy/docker-rust

By grummfy

•Updated about 9 years ago

Docker image for the Rust programming language and a few supporting tools.

Image
1

1.7K

grummfy/docker-rust repository overview

⁠docker-rust

Fork from Docker Hub⁠.

This repository is used to build a Docker image for the Rust programming language and a few supporting tools. The image includes the following tools :

  • rustc,
  • rustdoc,
  • cargo,
  • `cargo-check,
  • rusfmt
  • git,
  • SSL certificates,
  • build essentials,

So it should be able to run cargo build on most projects out of the box. The path /source is a volume where you can mount a Cargo project from the host machine.

⁠Usage

⁠work inside the docker

The following command will drop you into a Bash shell with the current directory on the host shared. From there you can run rustc, rustdoc, and cargo as you please.

docker run -it --rm -v $(pwd):/source grummfy/docker-rust
⁠work
⁠cargo command
docker run --rm -v $PWD:/source grummfy/docker-rust cargo run
⁠rustc
docker run --rm -v $PWD:/source grummfy/docker-rust rustc src/main.rs
⁠format (coding style) your code
docker run --rm -v $PWD:/source grummfy/docker-rust rustfmt src/main.rs

⁠Build it

docker build --build-arg RUST_VERSION=beta -t grummfy/docker-rust:beta-latest .
docker build --build-arg RUST_VERSION=stable -t grummfy/docker-rust:stable-latest .
docker build --build-arg RUST_VERSION=1.10.0 -t grummfy/docker-rust:1.10.0 .

⁠License

MIT⁠

Tag summary

Content type

Image

Digest

Size

385.3 MB

Last updated

about 9 years ago

docker pull grummfy/docker-rust:1.21.0