Skip to content

Commit

Permalink
Add docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
VOID404 committed Jul 9, 2024
1 parent 95ae18b commit fa79864
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM rust:latest AS builder
WORKDIR /makedot

RUN mkdir src && echo "fn main() {}" > src/main.rs
COPY ./Cargo.lock ./
COPY ./Cargo.toml ./
RUN cargo fetch
RUN cargo build --release
RUN rm -r src/
COPY ./src ./src
RUN cargo build --release

FROM scratch
COPY --from=builder /makedot/target/release/makedot /makedot
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ makedot ./hack/ci/Makefile | dot -T svg -o ./graph.svg
git clone --depth 1 https://github.com/VOID404/makedot.git
cargo build --release
./target/release/makedot
```

Alternatively you can build inside docker:
```sh
docker build --output=./target/release .
./target/release/makedot
```
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ fn main() {
std::process::exit(1);
});

eprintln!("Starting at {}", path);

let (makefiles, externals) = Makefile::walk_from(path);

let mut id = IDGen::new("cluster_");
Expand Down

0 comments on commit fa79864

Please sign in to comment.