Skip to content

Commit

Permalink
[ENH] chroma-load Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
rescrv committed Dec 3, 2024
1 parent 216ffb7 commit 524bd41
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions rust/load/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM rust:1.81.0 AS builder

ARG RELEASE_MODE=

WORKDIR /chroma/

COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
COPY idl/ idl/
COPY rust/ rust/

FROM builder AS load_service_builder
# sharing=locked is necessary to prevent cargo build from running concurrently on the same mounted directory
RUN --mount=type=cache,sharing=locked,target=/chroma/target/ \
--mount=type=cache,sharing=locked,target=/usr/local/cargo/registry/ \
if [ "$RELEASE_MODE" = "1" ]; then cargo build --bin chroma-load --release; else cargo build --bin chroma-load; fi && \
if [ "$RELEASE_MODE" = "1" ]; then mv target/release/chroma-load ./chroma-load; else mv target/debug/chroma-load ./chroma-load; fi

FROM debian:bookworm-slim AS runner
RUN apt-get update && apt-get install -y libssl-dev ca-certificates && rm -rf /var/lib/apt/lists/*
COPY --from=builder /chroma/rust/load/chroma_config.yaml .

FROM runner AS load_service
COPY --from=load_service_builder /chroma/chroma-load .
ENTRYPOINT [ "./chroma-load" ]

0 comments on commit 524bd41

Please sign in to comment.