-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile.interop
More file actions
61 lines (57 loc) · 1.85 KB
/
Copy pathDockerfile.interop
File metadata and controls
61 lines (57 loc) · 1.85 KB
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
58
59
60
61
ARG BINARY
ARG PROFILE=release
FROM rust:1.98.1-alpine AS chef
ENV CARGO_INCREMENTAL=0
RUN apk add --no-cache libc-dev
RUN cargo install cargo-chef --version 0.1.71 --locked && \
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 --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
ARG GIT_REVISION=unknown
ENV GIT_REVISION=${GIT_REVISION}
RUN cargo build --profile $PROFILE -p janus_interop_binaries
FROM alpine:3.24.2 AS final
ARG BINARY
ARG PROFILE
ARG GIT_REVISION=unknown
LABEL revision=${GIT_REVISION}
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"]