-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
33 lines (23 loc) · 861 Bytes
/
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
FROM rustlang/rust:nightly-bullseye-slim as build
RUN apt-get update && \
update-ca-certificates && \
apt-get install --no-install-recommends --assume-yes pkg-config libssl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN mkdir -p src/bin
COPY Cargo.toml Cargo.toml
COPY Cargo.lock Cargo.lock
COPY src/bin/elasticsearch_exporter.rs src/bin/elasticsearch_exporter.rs
RUN cargo fetch
COPY . .
RUN cargo build --bin elasticsearch_exporter --release
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates=20210119 && \
update-ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY --from=build /app/target/release/elasticsearch_exporter /usr/bin/elasticsearch_exporter
ENV RUST_LOG="info"
ENTRYPOINT ["elasticsearch_exporter"]