From 23f726e2880b5c295793443cf4f3628d47d137ae Mon Sep 17 00:00:00 2001 From: nicolas <48695862+merklefruit@users.noreply.github.com> Date: Fri, 8 Nov 2024 14:30:38 +0100 Subject: [PATCH] fix: make cargo chef detect binary --- bolt-cli/Cargo.toml | 5 ----- bolt-cli/Dockerfile | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bolt-cli/Cargo.toml b/bolt-cli/Cargo.toml index 09d759a6..64882c20 100644 --- a/bolt-cli/Cargo.toml +++ b/bolt-cli/Cargo.toml @@ -2,7 +2,6 @@ name = "bolt" version = "0.1.0" edition = "2021" -default-run = "bolt" [dependencies] # async @@ -41,7 +40,3 @@ tempfile = "3.13.0" [build-dependencies] tonic-build = "0.12.3" - -[[bin]] -name = "bolt" -path = "./src/main.rs" diff --git a/bolt-cli/Dockerfile b/bolt-cli/Dockerfile index c020a661..a2b7d868 100644 --- a/bolt-cli/Dockerfile +++ b/bolt-cli/Dockerfile @@ -13,6 +13,9 @@ FROM base AS planner # Copy only Cargo files to cache dependencies COPY Cargo.toml Cargo.lock ./ +# Copy the main.rs file to allow cargo do detect a binary +COPY src/main.rs ./src/main.rs + # Prepare the recipe for caching dependencies (Cargo.toml/Cargo.lock) RUN cargo chef prepare --recipe-path recipe.json