Skip to content

Commit

Permalink
Use --locked when installing the server in the Docker image.
Browse files Browse the repository at this point in the history
Same problem we had in [the orderly2 CI][mrc-ide/orderly2#134]. By
default `cargo install` ignores the lockfile and uses the latest
compatible version of dependencies available on `crates.io`. Something
changed in our dependency tree, and the build fails if the `Cargo.lock`
isn't used, breaking our Docker image build.

Regardless of this particular failure, I think we should always be using
the lockfile when assembling the Docker image. The lockfile represents
the set of versions that were used when running the test suite,
therefore this should be the versions we run in production. In a way we
got lucky that this change broke the build, rather than cause a change
in behaviour that might make the server misbehave in a way that the test
suite would have caught.

[mrc-ide/orderly2#134]: mrc-ide/orderly2#134
  • Loading branch information
plietar committed Apr 3, 2024
1 parent dbf23fb commit 5da1e49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM rust:latest as builder
WORKDIR /usr/src/outpack_server
COPY . .
RUN cargo install --path .
RUN cargo install --locked --path .

FROM debian:bookworm-slim

Expand Down

0 comments on commit 5da1e49

Please sign in to comment.