Skip to content

Commit decfc5a

Browse files
committed
Add rust-toolchain check to Dockerfile
1 parent 7d146f6 commit decfc5a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crates/standalone/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
# Warning: we removed binstall recently because they added a dependency on the QUIC protocol.
2-
31
ARG CARGO_PROFILE=release
42

53

64
FROM rust:1.74.0 AS chef
5+
# ensure ^^^^^^ and rust-toolchain.toml are in sync
6+
ADD rust-toolchain.toml .
7+
RUN if [[ $(awk '/^channel = "[0-9\.]+"$/{gsub(/"/, "", $3); print $3}' rust-toolchain.toml) != "$RUST_VERSION" ]]; \
8+
echo "Docker base doesn't match rust-toolchain.toml"; exit 1; \
9+
else rm -f rust-toolchain.toml; fi
10+
711
RUN rust_target=$(rustc -vV | awk '/^host:/{ print $2 }') && \
812
curl https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-$rust_target.tgz -fL | tar xz -C $CARGO_HOME/bin
913
RUN cargo binstall -y [email protected]
14+
1015
WORKDIR /usr/src/app
1116

1217
FROM chef AS planner

0 commit comments

Comments
 (0)