forked from vinted/elasticsearch-exporter-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (17 loc) · 685 Bytes
/
Dockerfile
File metadata and controls
28 lines (17 loc) · 685 Bytes
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
FROM rust:1.54.0 as build
WORKDIR /app
RUN apt-get update \
&& apt-get install --no-install-recommends -y musl-tools=1.1.21-2 \
&& rustup default nightly \
&& rustup target add x86_64-unknown-linux-musl
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 --target x86_64-unknown-linux-musl
FROM alpine:3.14.1
COPY --from=build /app/target/x86_64-unknown-linux-musl/release/elasticsearch_exporter /usr/bin/elasticsearch_exporter
ENV RUST_LOG="info"
ENTRYPOINT ["elasticsearch_exporter"]