From 7d1c89e2fadcf0121c738f4ce5cb858ad792401b Mon Sep 17 00:00:00 2001 From: keirsalterego Date: Mon, 25 May 2026 00:44:18 +0530 Subject: [PATCH] fix(docker): build on rust:1-bookworm + ignore target/ The image pinned rust:1.78, but a Cargo.lock dependency now requires the Rust 2024 edition (>= 1.85), so 'cargo build --release' failed with an edition-2024 error (builds fine locally on 1.95). Bumped the builder to rust:1-bookworm (glibc-compatible with the debian:bookworm-slim runtime). Added .dockerignore so the 1.7 GB target/ dir isn't shipped into the build context. Validated: the image now builds and runs in the compose stack. --- .dockerignore | 4 ++++ Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6847c9d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +target +.git +*.md +assets diff --git a/Dockerfile b/Dockerfile index 42d5e4d..2a955f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM rust:1.78 as builder +# A dependency in Cargo.lock requires the Rust 2024 edition (Rust >= 1.85), +# so the old rust:1.78 base failed to build. Track latest stable 1.x on +# bookworm so the produced binary is glibc-compatible with the runtime stage. +FROM rust:1-bookworm AS builder WORKDIR /app COPY . . RUN cargo build --release