use COPY to match chef docs
This commit is contained in:
parent
ee41f5f91d
commit
16e9727a97
24
Dockerfile
24
Dockerfile
@ -56,27 +56,26 @@ RUN --mount=type=cache,target=/usr/local/cargo/git \
|
|||||||
ENV WEB3_PROXY_FEATURES "rdkafka-src,connectinfo"
|
ENV WEB3_PROXY_FEATURES "rdkafka-src,connectinfo"
|
||||||
|
|
||||||
# chef plan
|
# chef plan
|
||||||
RUN --mount=type=bind,target=.,rw \
|
COPY . .
|
||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
RUN --mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/app/target \
|
--mount=type=cache,target=/app/target \
|
||||||
\
|
\
|
||||||
cargo chef prepare --recipe-path /recipe.json
|
cargo chef prepare --recipe-path recipe.json
|
||||||
|
|
||||||
FROM rust as build_tests
|
FROM rust as build_tests
|
||||||
|
|
||||||
# chef cook the test app
|
# chef cook the test app
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/git \
|
RUN --mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/app/target,id=build_tests_target \
|
--mount=type=cache,target=/app/target \
|
||||||
\
|
\
|
||||||
cargo chef cook --recipe-path /recipe.json
|
cargo chef cook --recipe-path recipe.json
|
||||||
|
|
||||||
# test the application with cargo-nextest
|
# test the application with cargo-nextest
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
|
||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/app/target,id=build_tests_target \
|
--mount=type=cache,target=/app/target \
|
||||||
\
|
\
|
||||||
cargo hakari generate --diff && \
|
cargo hakari generate --diff && \
|
||||||
cargo hakari manage-deps --dry-run && \
|
cargo hakari manage-deps --dry-run && \
|
||||||
@ -88,17 +87,16 @@ FROM rust as build_app
|
|||||||
# chef cook the app
|
# chef cook the app
|
||||||
RUN --mount=type=cache,target=/usr/local/cargo/git \
|
RUN --mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/app/target,id=build_app_target \
|
--mount=type=cache,target=/app/target \
|
||||||
\
|
\
|
||||||
cargo chef cook --release --recipe-path /recipe.json
|
cargo chef cook --release --recipe-path recipe.json
|
||||||
|
|
||||||
# build the application
|
# build the application
|
||||||
# using a "release" profile (which install does by default) is **very** important
|
# using a "release" profile (which install does by default) is **very** important
|
||||||
# TODO: use the "faster_release" profile which builds with `codegen-units = 1`
|
# TODO: use the "faster_release" profile which builds with `codegen-units = 1`
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=cache,target=/usr/local/cargo/git \
|
||||||
--mount=type=cache,target=/usr/local/cargo/git \
|
|
||||||
--mount=type=cache,target=/usr/local/cargo/registry \
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
||||||
--mount=type=cache,target=/app/target,id=build_app_target \
|
--mount=type=cache,target=/app/target \
|
||||||
\
|
\
|
||||||
cargo install \
|
cargo install \
|
||||||
--features "$WEB3_PROXY_FEATURES" \
|
--features "$WEB3_PROXY_FEATURES" \
|
||||||
|
Loading…
Reference in New Issue
Block a user