File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1- FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
1+ # Use specific version to avoid toolchain updates
2+ FROM lukemathwalker/cargo-chef:latest-rust-1.89.0-slim AS chef
23WORKDIR /tricked-bot
34
45FROM chef AS planner
@@ -7,13 +8,17 @@ RUN cargo chef prepare --recipe-path recipe.json
78
89FROM chef AS builder
910COPY --from=planner /tricked-bot/recipe.json recipe.json
10- # Build dependencies - this is the caching Docker layer!
11+
12+ # Cache Rust toolchain and cargo registry
1113RUN --mount=type=cache,target=/usr/local/cargo/registry \
14+ --mount=type=cache,target=/usr/local/rustup \
1215 --mount=type=cache,target=/tricked-bot/target \
1316 cargo chef cook --release --recipe-path recipe.json
14- # Build tricked-botlication
17+
18+ # Build application
1519COPY . .
1620RUN --mount=type=cache,target=/usr/local/cargo/registry \
21+ --mount=type=cache,target=/usr/local/rustup \
1722 --mount=type=cache,target=/tricked-bot/target \
1823 cargo build --release --bin tricked-bot && \
1924 cp /tricked-bot/target/release/tricked-bot /usr/local/bin/tricked-bot
You can’t perform that action at this time.
0 commit comments