From d72e80ce55f0e429ee483fdfe7dac82e988f3671 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Fri, 30 Aug 2024 12:02:24 +0200 Subject: [PATCH] Let's hope this works :fingers-crossed: --- .github/workflows/ci.yml | 2 +- docker/Dockerfile-debug | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2309847ea..109dc7389d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: with: cache-map: | { - "cargo": "~/.cargo", + "cargo-home": "/usr/src/app/cargo-home", "target": "/usr/src/app/target" } skip-extraction: ${{ steps.cache.outputs.cache-hit }} diff --git a/docker/Dockerfile-debug b/docker/Dockerfile-debug index 52da836ac9..3160a98162 100644 --- a/docker/Dockerfile-debug +++ b/docker/Dockerfile-debug @@ -13,23 +13,22 @@ FROM ghcr.io/restatedev/dev-tools:latest AS planner COPY --exclude=.git . . RUN just chef-prepare -FROM ghcr.io/restatedev/dev-tools:latest AS base +FROM ghcr.io/restatedev/dev-tools:latest AS builder +WORKDIR /usr/src/app + COPY --from=planner /restate/recipe.json recipe.json COPY justfile justfile - -FROM base AS builder -WORKDIR /usr/src/app # Caching layer if nothing has changed # Only build restate binary to avoid compiling unneeded crates RUN \ - --mount=type=cache,target=~/.cargo,sharing=locked \ + --mount=type=cache,target=/usr/src/app/cargo-home,sharing=locked \ --mount=type=cache,target=/usr/src/app/target,sharing=locked \ - just libc=gnu chef-cook --bin restate-server + CARGO_HOME=/usr/src/app/cargo-home just libc=gnu chef-cook --bin restate-server COPY . . RUN \ - --mount=type=cache,target=~/.cargo,sharing=locked \ + --mount=type=cache,target=/usr/src/app/cargo-home,sharing=locked \ --mount=type=cache,target=/usr/src/app/target,sharing=locked \ - just libc=gnu build --bin restate-server && \ + CARGO_HOME=/usr/src/app/cargo-home just libc=gnu build --bin restate-server && \ mv target/$(just libc=gnu print-target)/debug/restate-server target/restate-server # We do not need the Rust toolchain to run the server binary!