项目作者: realcundo

项目描述 :
Debian-based Docker image with stable+nightly cargo fmt, clippy and deny enabled.
高级语言: Dockerfile
项目地址: git://github.com/realcundo/docker-rust-aio.git
创建时间: 2020-07-15T16:13:47Z
项目社区:https://github.com/realcundo/docker-rust-aio

开源协议:MIT License

下载


docker-rust-aio

Debian Buster based Docker image with cargo fmt, clippy, release and deny enabled.

Useful to run cargo tools in your local CI without having to install cargo components manually.

Based on the latest official Rust docker image with both stable and nightly toolchains and tools enabled.
Target triple: *-x86_64-unknown-linux-gnu.

Included cargo commands:

Available linkers:

The docker image is built daily and if all tools are available, the image is pushed to Docker Hub.
The image is guaranteed to have all listed tools available both in stable and nightly.

Currently only :latest tag is available.

Running

Run as a local user using Rust project in local $PWD:

  1. docker run
  2. --rm \
  3. -t \
  4. --user "$(id -u)":"$(id -g)" \
  5. -v "$PWD:/usr/src/myapp" \
  6. realcundo/docker-rust-aio \
  7. cargo clippy

To preserve cargo build files between runs (e.g. for incremental builds), use

  1. mkdir "$LOCAL_RUST_CARGO_CACHE"
  2. docker run \
  3. --rm \
  4. -t \
  5. --user "$(id -u)":"$(id -g)" \
  6. -v "$PWD:/usr/src/myapp" \
  7. -v "$LOCAL_RUST_CARGO_CACHE:/usr/local/cargo/registry" \
  8. realcundo/docker-rust-aio \
  9. cargo clippy

Make sure that $LOCAL_RUST_CARGO_CACHE exists before running the docker container. Otherwise it’ll be created by docker as a root user and your local user won’t be able to access it.

Contributing

Feel free to open PRs to include your favourite cargo component.