forked from divviup/janus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.interop
57 lines (53 loc) · 1.8 KB
/
Dockerfile.interop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ARG BINARY
ARG PROFILE=release
FROM rust:1.82.0-alpine AS chef
ENV CARGO_INCREMENTAL=0
RUN apk add --no-cache libc-dev cmake make
RUN cargo install cargo-chef --version 0.1.60 && \
rm -r $CARGO_HOME/registry
WORKDIR /src
FROM chef AS planner
COPY Cargo.toml Cargo.lock /src/
COPY aggregator /src/aggregator
COPY aggregator_api /src/aggregator_api
COPY aggregator_core /src/aggregator_core
COPY client /src/client
COPY collector /src/collector
COPY core /src/core
COPY integration_tests /src/integration_tests
COPY interop_binaries /src/interop_binaries
COPY messages /src/messages
COPY tools /src/tools
COPY xtask /src/xtask
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /src/recipe.json /src/recipe.json
ARG PROFILE
RUN cargo chef cook --features fpvec_bounded_l2 --profile $PROFILE -p janus_interop_binaries
COPY Cargo.toml Cargo.lock /src/
COPY aggregator /src/aggregator
COPY aggregator_api /src/aggregator_api
COPY aggregator_core /src/aggregator_core
COPY client /src/client
COPY collector /src/collector
COPY core /src/core
COPY db /src/db
COPY integration_tests /src/integration_tests
COPY interop_binaries /src/interop_binaries
COPY messages /src/messages
COPY tools /src/tools
COPY xtask /src/xtask
RUN cargo build --features fpvec_bounded_l2 --profile $PROFILE -p janus_interop_binaries
FROM alpine:3.20.3 AS final
ARG BINARY
ARG PROFILE
RUN mkdir /logs
COPY --from=builder /src/target/$PROFILE/janus_interop /janus_interop
RUN ln -s /janus_interop /janus_interop_client && \
ln -s /janus_interop /janus_interop_collector
EXPOSE 8080
# Store the build argument in an environment variable so we can reference it
# from the ENTRYPOINT at runtime.
ENV BINARY=$BINARY
ENV RUST_LOG=info
ENTRYPOINT ["/bin/sh", "-c", "exec /$BINARY \"$@\" >/logs/stdout.log 2>/logs/stderr.log"]