79788651

Date: 2025-10-12 16:01:44
Score: 0.5
Natty:
Report link

As @david-maze said (thanks!), you need to add steps to the Dockerfile to build in a folder other than the root directory. Add lines like this to your Dockerfile:

COPY cargo.toml build.rs proto src /project
WORKDIR /project

And then you could just add RUN (or not just¹):

RUN cargo build

This will prevent Cargo's scope from scanning unnecessary system's files.

¹ RUN with cache and release:

RUN --mount=type=cache,target=/root/.cargo/registry \
    cargo clean; cargo build --release
Reasons:
  • Blacklisted phrase (0.5): thanks
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Михаил Сидоренко