add Dockerfile

This commit is contained in:
Robin Appelman 2020-01-25 15:29:43 +01:00
commit eb5dd8b3fe
2 changed files with 16 additions and 0 deletions

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM ekidd/rust-musl-builder AS build
# We need to add the source code to the image because `rust-musl-builder`
# assumes a UID of 1000, but TravisCI has switched to 2000.
ADD . ./
RUN sudo chown -R rust:rust .
RUN cargo build --release --no-default-features --features rustls-tls
FROM scratch
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/prometheus-edge-trigger /
CMD ["/prometheus-edge-trigger"]