Skip to content

Commit d023e8d

Browse files
vsochKobzol
authored andcommitted
add docker build of container
it would be nice to have a quick demo container or Dockerfile to build one for quickly testing out the software without needing to install anything to my system. This addition will add the Dockerfile, instructions in the README for build and usage, along with an automated build to deploy a container alongside the repository. Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent 30f4ea7 commit d023e8d

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target/

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
2+
3+
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
4+
WORKDIR /app
5+
6+
FROM chef as planner
7+
8+
COPY . .
9+
RUN cargo chef prepare --recipe-path recipe.json
10+
11+
FROM chef AS builder
12+
WORKDIR /build
13+
COPY --from=planner /app/recipe.json recipe.json
14+
15+
# Build dependencies and cache them in a Docker layer
16+
RUN cargo chef cook --release --recipe-path recipe.json
17+
18+
# Build HyperQueue itself
19+
COPY . .
20+
RUN cargo build --release
21+
22+
FROM ubuntu:22.04 AS runtime
23+
24+
WORKDIR /
25+
COPY --from=builder /build/target/release/hq hq
26+
27+
ENTRYPOINT ["./hq"]

0 commit comments

Comments
 (0)