From 5da1e491a3b06dbf5bf05ca8c4cb59a08da5c3e3 Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Wed, 3 Apr 2024 16:31:56 +0100 Subject: [PATCH] Use `--locked` when installing the server in the Docker image. 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]: https://github.com/mrc-ide/orderly2/pull/134 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5452b3e..6882d53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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