From 277bb8b39a28140c5ac226e86a8b0a5982d1f9e8 Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Thu, 6 Jan 2022 21:31:44 +0100 Subject: [PATCH] Build with Docker (#562) --- instructions/Compilation.md | 19 ++++++++++++++++++- misc/docker/Dockerfile | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 misc/docker/Dockerfile diff --git a/instructions/Compilation.md b/instructions/Compilation.md index 33b01bc..46458b8 100644 --- a/instructions/Compilation.md +++ b/instructions/Compilation.md @@ -43,6 +43,12 @@ Next install Rust from site https://rustup.rs/ After that the latest GTK 3 runtime must be installed from https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases --> +### Docker + +```shell +docker build ./misc/docker/ --tag cargo-gtk +``` + ## Compilation Czkawka can be installed with Debug or Release build. @@ -65,6 +71,17 @@ cargo run --release --bin czkawka_gui cargo run --release --bin czkawka_cli ``` +## Compilation with Docker + +```shell +docker run -t --rm --volume $PWD:/app --workdir /app cargo-gtk cargo build --release --bin czkawka_gui +``` + +Run the binary: + +```shell +target/release/czkawka_gui +``` ## Additional features For now, finding broken audio files is temporary disabled by default, because it crashes when audio libraries are not found on the computer. @@ -73,4 +90,4 @@ I'm waiting for ability to disable audio playback feature, so after that I will To enable checking for broken audio files, just add ` --all-features` ``` cargo run --all-features --bin czkawka_cli -- broken -d /home/rafal/ -f "results.txt" -``` \ No newline at end of file +``` diff --git a/misc/docker/Dockerfile b/misc/docker/Dockerfile new file mode 100644 index 0000000..5b6c58e --- /dev/null +++ b/misc/docker/Dockerfile @@ -0,0 +1,12 @@ +FROM debian:11 + +# curl is needed by Rust update tool +RUN apt-get update \ + && apt-get install -y curl build-essential libgtk-3-dev \ + && apt-get clean ; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # Download the latest stable Rust + +ENV PATH="/root/.cargo/bin:${PATH}" + +RUN cargo --version