diff --git a/rust/worker/Dockerfile b/rust/worker/Dockerfile index 2e3802787e1..ae9ce8f32df 100644 --- a/rust/worker/Dockerfile +++ b/rust/worker/Dockerfile @@ -6,7 +6,6 @@ WORKDIR / RUN git clone https://github.com/chroma-core/hnswlib.git WORKDIR /chroma/ -COPY . . ENV PROTOC_ZIP=protoc-25.1-linux-x86_64.zip RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v25.1/$PROTOC_ZIP \ @@ -14,7 +13,9 @@ RUN curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v25.1 && unzip -o $PROTOC_ZIP -d /usr/local 'include/*' \ && rm -f $PROTOC_ZIP -RUN cargo build +COPY . . + +RUN --mount=type=cache,target=/root/.cache/cargo CARGO_TARGET_DIR=/root/.cache/cargo cargo build WORKDIR /chroma/rust/worker