aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2024-05-17 14:25:52 -0500
committerMarc Coquand <marc@mccd.space>2024-05-17 14:25:52 -0500
commit0f36dee9ed3225662e551fce165e30867b246656 (patch)
tree31d0c65bb6374ba4f9fb04c39c413242e202dd82 /Dockerfile
parent12c6b55e7c1d53122ca73f2a8d0067d10060f0be (diff)
downloadstitch-0f36dee9ed3225662e551fce165e30867b246656.tar.gz
stitch-0f36dee9ed3225662e551fce165e30867b246656.tar.bz2
stitch-0f36dee9ed3225662e551fce165e30867b246656.zip
updates
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile24
1 files changed, 24 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..937fbcf
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,24 @@
+FROM alpine:edge AS builder
+
+# Install the build dependencies
+RUN apk add --no-cache make m4 which patch sudo wget git pkgconfig \
+ gcc g++ musl-dev linux-headers libffi libffi-dev pcre perl python3 \
+ gmp-dev pcre-dev xz-dev gmp xz coreutils \
+ ocaml ocaml-compiler-libs ocaml-ocamldoc opam ocaml-findlib openssh
+RUN chmod +s `which bwrap`
+
+RUN addgroup -g 1000 -S ocaml && adduser -u 1000 -D -S ocaml -G ocaml
+USER ocaml
+WORKDIR /home/ocaml
+
+RUN opam init --auto-setup --disable-sandboxing --yes -c 4.14.2 --keep-build-dir
+RUN eval `opam env --switch=4.14.2`
+
+RUN opam install --yes dune && eval `opam env --switch=4.14.2`
+
+COPY --chown=ocaml:ocaml . /tmp/build
+WORKDIR /tmp/build
+RUN git config --global --add safe.directory /tmp/build
+
+RUN opam install . --update-invariant --yes
+CMD eval `opam env` && dune build --profile release