Skip to content

Commit 9b2a325

Browse files
committed
pin chef
1 parent 138edf3 commit 9b2a325

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
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
23
WORKDIR /tricked-bot
34

45
FROM chef AS planner
@@ -7,13 +8,17 @@ RUN cargo chef prepare --recipe-path recipe.json
78

89
FROM chef AS builder
910
COPY --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
1113
RUN --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
1519
COPY . .
1620
RUN --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

0 commit comments

Comments
 (0)