Skip to content

Commit

Permalink
add docker build of container
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vsoch committed May 2, 2023
1 parent 30f4ea7 commit 7f8896a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target/
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef

ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
WORKDIR /app

FROM chef as planner

COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
WORKDIR /build
COPY --from=planner /app/recipe.json recipe.json

# Build dependencies and cache them in a Docker layer
RUN cargo chef cook --release --recipe-path recipe.json

# Build HyperQueue itself
COPY . .
RUN cargo build --release

FROM ubuntu:22.04 AS runtime

WORKDIR /
COPY --from=builder /build/target/release/hq hq

ENTRYPOINT ["./hq"]

0 comments on commit 7f8896a

Please sign in to comment.