Skip to content

Commit

Permalink
Refactoring dockerfile, adding one specific for just build and updati…
Browse files Browse the repository at this point in the history
…ng README to reflect chnages
  • Loading branch information
br0kej committed Dec 6, 2023
1 parent f0e1ba9 commit 5ffaabf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ WORKDIR /opt/bin2ml
RUN env USER=root cargo init .

COPY Cargo.toml .
COPY Cargo.lock .
COPY src /opt/bin2ml/src

RUN cd /opt/bin2ml && \
Expand All @@ -17,4 +16,7 @@ FROM rust

COPY --from=builder /usr/local/cargo/bin/bin2ml /usr/local/cargo/bin/bin2ml

RUN git clone https://github.com/radareorg/radare2 radare2
RUN cd radare2 ; sys/install.sh

CMD bin2ml --version
19 changes: 19 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM rust as builder

WORKDIR /opt/bin2ml

RUN env USER=root cargo init .

COPY Cargo.toml .
COPY src /opt/bin2ml/src

RUN cd /opt/bin2ml && \
cargo install --locked --path . && \
rm -rf /opt/bin2ml && \
rm -rf /usr/local/cargo/registry

FROM rust

COPY --from=builder /usr/local/cargo/bin/bin2ml /usr/local/cargo/bin/bin2ml

CMD bin2ml --version
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ git clone https://github.com/br0kej/bin2ml
cd bin2ml
cargo build --release
```
Alternatively, there is a Dockerfile provided too which provides a means of creating a container with a ready to go version of `bin2ml` in it

Alternatively, there are two Dockerfile's provided. `Dockerfile.build` can be used to build the `bin2ml` binary without having to have cargo on your workstation or `Dockerfile` builds `bin2ml` as well as installing radare2 to provide a means of doing processing within the container.
## Docs
`bin2ml` does come with some documentation (albeit incomplete) and has been developed using `mdbook`. The documentation can be locally served by installing the platform relevant version of `mdbook` from [here](https://github.com/rust-lang/mdBook/releases)
and then executing the commands below:
Expand Down

0 comments on commit 5ffaabf

Please sign in to comment.