Skip to content

Commit 6c05775

Browse files
authoredOct 21, 2020
Add some instructions to create contributing development environment. (#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.
1 parent 043be7d commit 6c05775

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
 

‎contributing.Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM rust
2+
# Install nmap first.
3+
RUN apt-get update -qy && apt-get install -qy nmap
4+
# Then install rustfmt and clippy for cargo.
5+
RUN rustup component add rustfmt clippy

‎contributing.md

+35
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,38 @@ If you have any feature suggestions or bugs, leave a GitHub issue. We welcome an
2929

3030
## Rewarding you
3131
I cannot pay you :-( But, I can place your GitHub profile on the README under `#Contributors` as a thank you! :)
32+
33+
## Contributing development environment
34+
35+
To ease contribution to RustScan, you can use the `contributing.Dockerfile` to create a Docker image ready to build and play with RustScan.
36+
To build it you just need to run:
37+
38+
```bash
39+
you@home:~/RustScan$ docker build -t rustscan_contributing -f contributing.Dockerfile
40+
```
41+
42+
Then you need to run the container with a volume so it can access, *with read and write permissions*, to RustScan files:
43+
44+
```bash
45+
you@home:~/RustScan$ docker run -ti --rm -v "$PWD":/rustscan -w /rustscan rustscan_contributing bash
46+
```
47+
48+
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:
49+
50+
```bash
51+
root@container:/rustscan# cargo build
52+
```
53+
54+
You are now ready to use RustScan:
55+
56+
```bash
57+
root@container:/rustscan# cargo run -- -b 2000 -t 5000 -a 127.0.0.1
58+
```
59+
60+
You can also format, lint with `clippy` and test the code with the following commands:
61+
62+
```bash
63+
root@container:/rustscan# cargo fmt
64+
root@container:/rustscan# cargo clippy
65+
root@container:/rustscan# cargo test
66+
```

0 commit comments

Comments
 (0)
Please sign in to comment.