Skip to content

Commit

Permalink
[ENH]: make rust docker image build faster with cache (#1730)
Browse files Browse the repository at this point in the history
## Description of changes

*Summarize the changes made by this PR.*
 - Improvements & Bug fixes
	 - Use docker cache for faster tilt restart.

## Test plan
*How are these changes tested?*

- With tilt

Co-authored-by: nicolas <[email protected]>
  • Loading branch information
nicolasgere and nicolas authored Feb 29, 2024
1 parent 87e5903 commit eae915d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rust/worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ 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 \
&& unzip -o $PROTOC_ZIP -d /usr/local bin/protoc \
&& 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

Expand Down

0 comments on commit eae915d

Please sign in to comment.