Skip to content

Commit

Permalink
Add some instructions to create contributing development environment. (
Browse files Browse the repository at this point in the history
…RustScan#298)

A new Dockerfile "contributing.Dockerfile" was added.
This Dockerfile permits creating a "ready to develop" container image to ease
contributing to RustScan.
The instructions to use it are detailed in contributing.md.
  • Loading branch information
eiffel-fl authored Oct 21, 2020
1 parent 043be7d commit 6c05775
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contributing.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM rust
# Install nmap first.
RUN apt-get update -qy && apt-get install -qy nmap
# Then install rustfmt and clippy for cargo.
RUN rustup component add rustfmt clippy
35 changes: 35 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,38 @@ If you have any feature suggestions or bugs, leave a GitHub issue. We welcome an

## Rewarding you
I cannot pay you :-( But, I can place your GitHub profile on the README under `#Contributors` as a thank you! :)

## Contributing development environment

To ease contribution to RustScan, you can use the `contributing.Dockerfile` to create a Docker image ready to build and play with RustScan.
To build it you just need to run:

```bash
you@home:~/RustScan$ docker build -t rustscan_contributing -f contributing.Dockerfile
```

Then you need to run the container with a volume so it can access, *with read and write permissions*, to RustScan files:

```bash
you@home:~/RustScan$ docker run -ti --rm -v "$PWD":/rustscan -w /rustscan rustscan_contributing bash
```

You can now modify RustScan files with your favorite editor, once you want to compile and test your modifications, type the following in the container prompt:

```bash
root@container:/rustscan# cargo build
```

You are now ready to use RustScan:

```bash
root@container:/rustscan# cargo run -- -b 2000 -t 5000 -a 127.0.0.1
```

You can also format, lint with `clippy` and test the code with the following commands:

```bash
root@container:/rustscan# cargo fmt
root@container:/rustscan# cargo clippy
root@container:/rustscan# cargo test
```

0 comments on commit 6c05775

Please sign in to comment.