Copying the `Cargo.lock` file into the `WORKDIR /usr/src/explorer` Docker container was causing the compiler to complain as if the lock file required all the Cargo.toml in the workspace to be accessible as well. (we infer this as `chronik/abc-rust-error` is the first member in the root `Cargo.toml` workspace.
`(myenv) ➜ bitcoin-abc git:(docker_fix) ✗ docker build -f explorer.Dockerfile -t my-explorer-image .
[+] Building 1.5s (13/13) FINISHED docker:desktop-linux
=> [internal] load build definition from explorer.Dockerfile 0.0s
=> => transferring dockerfile: 910B 0.0s
=> [internal] load metadata for docker.io/library/rust:1.72-slim-bookworm 0.5s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/9] FROM docker.io/library/rust:1.72-slim-bookworm@sha256:ff798ceb500fa43c91db10db881066057fefd36e16d531e7b1ed228ab22 0.0s
=> [internal] load build context 0.3s
=> => transferring context: 1.06MB 0.3s
=> CACHED [2/9] RUN apt-get update && apt-get upgrade -y && apt-get install -y libssl-dev pkg-config protobuf-compiler 0.0s
=> CACHED [3/9] WORKDIR /usr/src/explorer 0.0s
=> CACHED [4/9] COPY Cargo.toml Cargo.lock ./ 0.0s
=> CACHED [5/9] COPY web/explorer /usr/src/explorer/web/explorer 0.0s
=> [6/9] RUN ls -R /usr/src/explorer/web/explorer/explorer-exe 0.2s
=> [7/9] WORKDIR /usr/src/explorer/web/explorer/explorer-exe 0.0s
=> [8/9] RUN mv config.dist.toml config.toml 0.1s
=> ERROR [9/9] RUN cargo build --release 0.2s
------
> [9/9] RUN cargo build --release:
0.180 error: failed to load manifest for workspace member `/usr/src/explorer/chronik/abc-rust-error`
0.180
0.180 Caused by:
0.180 failed to read `/usr/src/explorer/chronik/abc-rust-error/Cargo.toml`
0.180
0.180 Caused by:
0.180 No such file or directory (os error 2)
------
explorer.Dockerfile:26
--------------------
24 |
25 | # Build the project
26 | >>> RUN cargo build --release
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 101
(myenv) ➜ bitcoin-abc git:(docker_fix) ✗ docker build -f explorer.Dockerfile -t my-explorer-image .`
Removed the `--locked` flag from `explorer.Dockerfile` and `build-configurations.yml`. By having `--locked` in the build-explorer configuration but not in the Dockerfile, we would create a mismatch between our local and CI/CD environments.