diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fec8a0c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +/target +/.vscode +/.idea +/.github +/.devcontainer +/.git +/.circleci +/test_files \ No newline at end of file diff --git a/README.md b/README.md index 0dde1a4..ff7f08e 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,18 @@ [![Crates.io](https://img.shields.io/crates/v/ssimulacra2_rs?style=for-the-badge)](https://crates.io/crates/ssimulacra2_rs) [![LICENSE](https://img.shields.io/crates/l/ssimulacra2_rs?style=for-the-badge)](https://github.com/rust-av/ssimulacra2_bin/blob/main/LICENSE) -Binary interface to the Rust implementation of the SSIMULACRA2 metric: https://github.com/rust-av/ssimulacra2 +Binary interface to the Rust implementation of the SSIMULACRA2 metric: + +## Docker + +First build the image + +```bash +docker build -t ssimulacra2_bin . +``` + +Then run it: + +```bash +docker run --rm -v $(PWD):/files ssimulacra2_bin image /files/source.png /files/distorted.png +``` diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..156e4b3 --- /dev/null +++ b/dockerfile @@ -0,0 +1,14 @@ +# Build project +FROM rust:latest as builder +WORKDIR /volume +COPY . . +RUN apt-get update && apt-get install -y libavutil-dev libavformat-dev clang && rm -rf /var/lib/apt/lists/* +RUN env RUSTFLAGS="-C target-cpu=haswell" cargo build --profile=release + +# Setup actual executing image +FROM debian +RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/* +COPY --from=builder /volume/target/release/ssimulacra2_rs /ssimulacra2_rs +RUN mkdir /files + +ENTRYPOINT ["/ssimulacra2_rs"]