File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ RUN apk add --no-cache musl-dev
1111WORKDIR /redlib
1212
1313# download (most) dependencies in their own layer
14- COPY Cargo.lock Cargo.toml ./
14+ COPY Cargo.lock Cargo.toml build.rs ./
1515RUN mkdir src && echo "fn main() { panic!(\"why am i running?\") }" > src/main.rs
1616RUN cargo build --release --locked --bin redlib
1717RUN rm ./src/main.rs && rmdir ./src
1818
1919# copy the source and build the redlib binary
2020COPY . ./
21- RUN cargo build --release --locked --bin redlib
21+ RUN touch src/main.rs && cargo build --release --locked --bin redlib
2222RUN echo "finished building redlib!"
2323
2424########################
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ FROM rust:${RUST_BUILDER_VERSION} AS builder
1010WORKDIR /redlib
1111
1212# download (most) dependencies in their own layer
13- COPY Cargo.lock Cargo.toml ./
13+ COPY Cargo.lock Cargo.toml build.rs ./
1414RUN mkdir src && echo "fn main() { panic!(\"why am i running?\") }" > src/main.rs
1515RUN cargo build --release --locked --bin redlib
1616RUN rm ./src/main.rs && rmdir ./src
1717
1818# copy the source and build the redlib binary
1919COPY . ./
20- RUN cargo build --release --locked --bin redlib
20+ RUN touch src/main.rs && cargo build --release --locked --bin redlib
2121RUN echo "finished building redlib!"
2222
2323########################
You can’t perform that action at this time.
0 commit comments