From 582fb38a7f64594ab0c88bf3034faef31729bdf4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 14 Jul 2020 15:02:15 +0200 Subject: [PATCH] add dockerfile --- .dockerignore | 6 ++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- Dockerfile | 12 ++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d1929e3 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +target +.git +.idea +Dockerfile +.dockerignore +.env \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 71a0365..e0a4d4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7,7 +7,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] -name = "backup-rs" +name = "backup" version = "0.1.0" dependencies = [ "chrono", diff --git a/Cargo.toml b/Cargo.toml index d6b690e..c294f06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "backup-rs" +name = "backup" version = "0.1.0" authors = ["Robin Appelman "] edition = "2018" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7941076 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM ekidd/rust-musl-builder AS build + +ADD . ./ +RUN sudo chown -R rust:rust . + +RUN cargo build --release + +FROM alpine:latest + +COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/backup / + +CMD ["/backup"] \ No newline at end of file