-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (42 loc) · 1.52 KB
/
Dockerfile
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
62
63
64
65
66
FROM node:20-alpine as uibuilder
WORKDIR /volume
COPY archer-ui/ ./
RUN yarn install && yarn run build
FROM rust:1.81 as chef
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN apt-get update && \
apt-get install -y --no-install-recommends musl-tools && \
rustup target add x86_64-unknown-linux-musl && \
cargo install cargo-chef
WORKDIR /volume
FROM chef as planner
COPY ./ ./
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
COPY --from=planner /volume/recipe.json recipe.json
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
COPY archer-http/ archer-http/
COPY archer-proto/ archer-proto/
COPY opentelemetry-proto/ opentelemetry-proto/
COPY src/ src/
COPY tracing-archer/ tracing-archer/
COPY build.rs Cargo.lock Cargo.toml ./
COPY --from=uibuilder /volume/packages/jaeger-ui/build/ archer-ui/packages/jaeger-ui/build/
RUN cargo build --release --target x86_64-unknown-linux-musl
FROM alpine:3 as newuser
RUN echo "archer:x:1000:" > /tmp/group && \
echo "archer:x:1000:1000::/dev/null:/sbin/nologin" > /tmp/passwd && \
mkdir /var/lib/archer
FROM scratch
COPY --from=builder /volume/target/x86_64-unknown-linux-musl/release/archer /bin/
COPY --from=newuser /tmp/group /tmp/passwd /etc/
COPY --from=newuser --chown=1000 /var/lib/archer /var/lib/
# Jaeger Query ports
EXPOSE 16686
# OTLP Collector ports
EXPOSE 4317 4318
# Quiver Collector port
EXPOSE 14000/udp
USER archer
ENTRYPOINT ["/bin/archer"]