File tree Expand file tree Collapse file tree 2 files changed +24
-16
lines changed Expand file tree Collapse file tree 2 files changed +24
-16
lines changed Original file line number Diff line number Diff line change 11FROM rust:latest AS base
2- RUN cargo install sccache --version ^0.7
3- RUN cargo install cargo-chef --version ^0.1
4- ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
5-
6- FROM base AS planner
2+
73WORKDIR /app
4+
85COPY . .
9- RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
10- cargo chef prepare --recipe-path recipe.json
11-
12- FROM base as builder
13- WORKDIR /app
14- COPY --from=planner /app/recipe.json recipe.json
15- RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
16- cargo chef cook --release --recipe-path recipe.json
17- COPY . .
18- RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
19- cargo xtask init
6+
7+ RUN cargo build --profile ephemeral-build
8+ RUN cargo xtask init
Original file line number Diff line number Diff line change 1+ FROM rust:latest AS base
2+ RUN cargo install sccache --version ^0.7
3+ RUN cargo install cargo-chef --version ^0.1
4+ ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
5+
6+ FROM base AS planner
7+ WORKDIR /app
8+ COPY . .
9+ RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
10+ cargo chef prepare --recipe-path recipe.json
11+
12+ FROM base as builder
13+ WORKDIR /app
14+ COPY --from=planner /app/recipe.json recipe.json
15+ RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
16+ cargo chef cook --release --recipe-path recipe.json
17+ COPY . .
18+ RUN --mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
19+ cargo xtask init
You can’t perform that action at this time.
0 commit comments