forked from KonradHoeffner/rickview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
25 lines (22 loc) · 789 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# syntax=docker/dockerfile:1.4
FROM clux/muslrust:1.65.0-nightly-2022-09-02 AS chef
USER root
RUN cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
ARG CARGO_INCREMENTAL=0
COPY --link . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
ARG CARGO_INCREMENTAL=0
COPY --link --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
COPY --link . .
RUN cargo build --release --target x86_64-unknown-linux-musl
FROM alpine AS runtime
RUN addgroup -S myuser && adduser -S myuser -G myuser
COPY --link --from=builder /app/target/x86_64-unknown-linux-musl/release/rickview /usr/local/bin/
USER myuser
WORKDIR /app
RUN mkdir -p data && touch data/kb.ttl
CMD ["/usr/local/bin/rickview"]