From 0964c83da899c88c76319d12f1c3601877533e41 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Fri, 16 Feb 2024 23:32:23 +0100 Subject: [PATCH 1/2] Adds a Dockerfile --- Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..196d8b3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM ocaml/opam:alpine-3.18-ocaml-4.14 as build + + +WORKDIR /home/opam + + +COPY --chown=opam:opam . . + +RUN make deps +RUN make +RUN make install + +CMD rat From 11b480b3e3757b0eac388e51711c41f54eb4c8d6 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Fri, 16 Feb 2024 23:34:20 +0100 Subject: [PATCH 2/2] Add docker usage example to README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e87e559..33c3822 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,16 @@ dune exec rat -- Run with `--help` to print the help message. If there are no arguments, the command runs the interactive interpreter. +To run `rat` inside Docker: + +``` bash +# Build (you just need to do this once +docker build . -t rat:latest + +# Example of running rat with arguments +docker run rat:latest rat --regex '(a|a)*b' +``` + ## Example Analysis Assume we have `rat` installed on the machine.