Browse Source

bump alpine & OCaml version in use for httpaf framework (#6940)

Robin Björklin 3 years ago
parent
commit
e081bdfb65
1 changed files with 29 additions and 4 deletions
  1. 29 4
      frameworks/OCaml/httpaf/httpaf.dockerfile

+ 29 - 4
frameworks/OCaml/httpaf/httpaf.dockerfile

@@ -1,17 +1,42 @@
 # -*- mode: dockerfile -*-
 
-FROM ocurrent/opam:alpine-3.12-ocaml-4.11
+FROM alpine:3.15
 
+# https://caml.inria.fr/pub/docs/manual-ocaml/libref/Gc.html
+# https://linux.die.net/man/1/ocamlrun
+# https://blog.janestreet.com/memory-allocator-showdown/
+ENV OCAMLRUNPARAM a=2,o=240
+
+RUN apk add --no-cache \
+    bash\
+    bubblewrap\
+    coreutils\
+    gcc\
+    git\
+    libev-dev\
+    libffi-dev\
+    linux-headers\
+    m4\
+    make\
+    musl-dev\
+    opam\
+    postgresql-dev
+
+RUN opam init\
+    --disable-sandboxing\
+    --auto-setup\
+    --compiler ocaml-base-compiler.4.13.1
+
+RUN opam install -y opam-depext
 RUN \
-  opam depext dune conf-libev httpaf httpaf-lwt-unix lwt yojson && \
-  opam install dune conf-libev httpaf httpaf-lwt-unix lwt yojson
+  opam depext -y dune conf-libev httpaf httpaf-lwt-unix lwt yojson && \
+  opam install -y dune conf-libev httpaf httpaf-lwt-unix lwt yojson
 
 COPY . /app
 
 WORKDIR /app
 
 RUN \
-  sudo chown -R opam: . && \
   eval $(opam env) && \
   dune build --release httpaf_unix.exe