cargo-chef icon indicating copy to clipboard operation
cargo-chef copied to clipboard

Clarify what `chef` needs in the build context

Open michaelbeaumont opened this issue 11 months ago • 3 comments

In the example Dockerfile we see multiple:

COPY . .

Can it be clarified what's actually needed by chef here? It doesn't seem to need target, for example, right?

Can we just put

COPY Cargo.toml Cargo.lock ./
COPY src ./src

in the example or otherwise include a minimal .dockerignore?

michaelbeaumont avatar Jan 31 '25 12:01 michaelbeaumont

I also include the .cargo directory, since sometimes I have workspace-wide build configurations or custom registries set up. My .dockerignore ends up looking like this: https://github.com/0xangelo/cargo-workspace-template/blob/main/.dockerignore

0xangelo avatar Feb 09 '25 11:02 0xangelo

please carify this, right now i have the following in my .dockerignore:

*

!.cargo
!src/
!Cargo.lock
!Cargo.toml

Also you must include in this list any folder/file you reference in your code

sergiomeneses avatar Apr 28 '25 19:04 sergiomeneses

Same question

failable avatar Sep 19 '25 15:09 failable