mirror of
https://github.com/vbrandl/bind9-api.git
synced 2024-11-22 05:43:49 +01:00
Add Dockerfile
This commit is contained in:
parent
bee19e4c78
commit
c42640a088
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
FROM lukemathwalker/cargo-chef as planner
|
||||||
|
WORKDIR app
|
||||||
|
COPY . .
|
||||||
|
RUN cargo chef prepare --recipe-path recipe.json
|
||||||
|
|
||||||
|
FROM lukemathwalker/cargo-chef as cacher
|
||||||
|
WORKDIR app
|
||||||
|
COPY --from=planner /app/recipe.json recipe.json
|
||||||
|
RUN cargo chef cook --release --recipe-path recipe.json
|
||||||
|
|
||||||
|
FROM rust as builder
|
||||||
|
WORKDIR app
|
||||||
|
COPY . .
|
||||||
|
# Copy over the cached dependencies
|
||||||
|
COPY --from=cacher /app/target target
|
||||||
|
COPY --from=cacher $CARGO_HOME $CARGO_HOME
|
||||||
|
RUN cargo build --release --bin bind9-api
|
||||||
|
|
||||||
|
FROM rust as runtime
|
||||||
|
WORKDIR app
|
||||||
|
COPY --from=builder /app/target/release/bind9-api /usr/local/bin
|
||||||
|
ENTRYPOINT ["/usr/local/bin/bind9-api"]
|
1
recipe.json
Normal file
1
recipe.json
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user