Skip to content

Commit

Permalink
fix(build): fix cached docker build.
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed May 25, 2024
1 parent 0e4cee7 commit cdcc3b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ COPY . /home/rust/src
RUN --mount=type=cache,target=/home/rust/src/target \
--mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
cargo build --release
cargo build --release \
mv /home/rust/src/target/x86_64-unknown-linux-musl/release/backend /backend

FROM scratch
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/backend /backend
COPY --from=build /backend /backend
ENTRYPOINT ["/backend"]

0 comments on commit cdcc3b1

Please sign in to comment.