-
Notifications
You must be signed in to change notification settings - Fork 350
/
Dockerfile
76 lines (56 loc) · 2.17 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
67
68
69
70
71
72
73
74
75
76
FROM node:20 as ui-builder
COPY quickwit/quickwit-ui /quickwit/quickwit-ui
WORKDIR /quickwit/quickwit-ui
RUN touch .gitignore_for_build_directory \
&& NODE_ENV=production make install build
FROM rust:bookworm AS bin-builder
ARG CARGO_FEATURES=release-feature-set
ARG CARGO_PROFILE=release
ARG QW_COMMIT_DATE
ARG QW_COMMIT_HASH
ARG QW_COMMIT_TAGS
ENV QW_COMMIT_DATE=$QW_COMMIT_DATE
ENV QW_COMMIT_HASH=$QW_COMMIT_HASH
ENV QW_COMMIT_TAGS=$QW_COMMIT_TAGS
RUN apt-get -y update \
&& apt-get -y install ca-certificates \
clang \
cmake \
libssl-dev \
llvm \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
# Required by tonic
RUN rustup component add rustfmt
COPY quickwit /quickwit
COPY config/quickwit.yaml /quickwit/config/quickwit.yaml
COPY --from=ui-builder /quickwit/quickwit-ui/build /quickwit/quickwit-ui/build
WORKDIR /quickwit
RUN echo "Building workspace with feature(s) '$CARGO_FEATURES' and profile '$CARGO_PROFILE'" \
&& RUSTFLAGS="--cfg tokio_unstable" \
cargo build \
-p quickwit-cli \
--features $CARGO_FEATURES \
--bin quickwit \
$(test "$CARGO_PROFILE" = "release" && echo "--release") \
&& echo "Copying binaries to /quickwit/bin" \
&& mkdir -p /quickwit/bin \
&& find target/$CARGO_PROFILE -maxdepth 1 -perm /a+x -type f -exec mv {} /quickwit/bin \;
FROM debian:bookworm-slim AS quickwit
LABEL org.opencontainers.image.title="Quickwit"
LABEL maintainer="Quickwit, Inc. <[email protected]>"
LABEL org.opencontainers.image.vendor="Quickwit, Inc."
LABEL org.opencontainers.image.licenses="AGPL-3.0"
RUN apt-get -y update \
&& apt-get -y install ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /quickwit
RUN mkdir config qwdata
COPY --from=bin-builder /quickwit/bin/quickwit /usr/local/bin/quickwit
COPY --from=bin-builder /quickwit/config/quickwit.yaml /quickwit/config/quickwit.yaml
ENV QW_CONFIG=/quickwit/config/quickwit.yaml
ENV QW_DATA_DIR=/quickwit/qwdata
ENV QW_LISTEN_ADDRESS=0.0.0.0
RUN quickwit --version
ENTRYPOINT ["quickwit"]