-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (28 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
43 lines (28 loc) · 1.01 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from rust:slim-trixie as rust-base
workdir /app
run cargo install cargo-chef
run apt update && apt install -y clang llvm pkg-config nettle-dev
# ---
from rust-base as plan
run --mount=type=bind,target=. cargo chef prepare --recipe-path /recipe.json
# ---
from rust-base as build
run apt update && apt install -y git python3 wget unzip fontforge clang
run --mount=type=bind,source=download_font.sh,target=download_font.sh \
./download_font.sh
copy --from=plan /recipe.json .
run --mount=type=cache,target=/app/target/,sharing=locked \
cargo chef cook \
--recipe-path recipe.json \
--release --no-default-features --features prod
copy . .
run --mount=type=cache,target=/app/target/,sharing=locked \
cargo build --release --no-default-features --features prod --bin bot && \
cp /app/target/release/bot /
# ---
from debian:trixie-slim
run groupadd -r ponyo && useradd -r -g ponyo ponyo
# run apt update && apt install -y nettle
user ponyo
copy --from=build --chown=ponyo:ponyo /bot .
cmd ["/bot"]