From 83a605cf61c0c69c2f685840dff41a1252e4bdce Mon Sep 17 00:00:00 2001 From: kawaegle Date: Thu, 1 Jun 2023 16:10:11 +0200 Subject: [PATCH 1/2] offer docker to this project --- Dockerfile | 9 +++++++++ README.md | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20a1d37 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM rust:buster as builder +COPY . /test +WORKDIR /test +RUN cargo install --bins --path . + + +FROM debian:bullseye-slim +COPY --from=builder /usr/local/cargo/bin/dipc /usr/local/bin/dipc +ENTRYPOINT [ "/usr/local/bin/dipc" ] diff --git a/README.md b/README.md index ab68746..e55229d 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,22 @@ cargo install --path . ``` This will build and install `dipc` in your `~/.cargo/bin`. Make sure that `~/.cargo/bin` is in your `$PATH` variable. +### Docker +## Installation + +``` +user@machine$: git clone https://github.com/doprz/dipc +user@machine$: cd dipc +user@machine$: docker build -t . +``` + +## Usage + +``` +user@machine$: docker run -v : -v : --rm --dir-output +``` + + ## Usage ``` From 47afd1acd304bf1c70f98f3be65733095c170ee9 Mon Sep 17 00:00:00 2001 From: kawaegle Date: Thu, 10 Aug 2023 09:28:38 +0200 Subject: [PATCH 2/2] update dockerfile so using alpine is better and lightweight --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 20a1d37..8a5f27b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM rust:buster as builder +FROM rust:alpine as builder +RUN apk add --no-cache libc-dev COPY . /test WORKDIR /test RUN cargo install --bins --path . - -FROM debian:bullseye-slim -COPY --from=builder /usr/local/cargo/bin/dipc /usr/local/bin/dipc -ENTRYPOINT [ "/usr/local/bin/dipc" ] +FROM alpine +COPY --from=builder /usr/local/cargo/bin/dipc /bin/ +ENTRYPOINT [ "/bin/dipc" ]