-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.alpine
59 lines (49 loc) · 2.94 KB
/
Dockerfile.alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
##########################################################################
# This file is part of the Codex semantics library. #
# #
# Copyright (C) 2013-2024 #
# CEA (Commissariat à l'énergie atomique et aux énergies #
# alternatives) #
# #
# you can redistribute it and/or modify it under the terms of the GNU #
# Lesser General Public License as published by the Free Software #
# Foundation, version 2.1. #
# #
# It is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU Lesser General Public License for more details. #
# #
# See the GNU Lesser General Public License version 2.1 #
# for more details (enclosed in the file LICENSE). #
# #
##########################################################################
# Build with docker build -f Dockerfile.alpine -t codexalpine .
# Debug with docker run -ti codexalpine sh
# Finish with docker cp codexalpine:/home/ocaml/codex/_build/default/binsec/binsec_codex.exe .
# Start with an alpine linux image with opam in it, for musl
FROM ocamlpro/ocaml:4.14 as first
RUN opam update
RUN opam switch create optstatic --packages=ocaml-variants.4.14.1+options,ocaml-option-static,ocaml-option-flambda,ocaml-option-no-flat-float-array
RUN opam switch optstatic
RUN eval $(opam env)
RUN opam install binsec bheap
# C++ is needed for cudd.
RUN sudo apk add g++
RUN opam install mlcuddidl
RUN opam install camlp-streams
# bash needed for core, needed for ppx_inline_test.
RUN sudo apk add bash
RUN opam install qcheck-core ppx_inline_test unionFind pacomb patricia-tree
# Install the patched Frama-C. This is cached if ext/frama_c_with_cudd does not change.
RUN opam install ppx_deriving_yaml ppx_deriving_yojson dune-configurator ppx_import cppo
COPY --chown=ocaml:ocaml ext/frama_c_with_cudd/*.patch ext/frama_c_with_cudd/Makefile /home/ocaml/frama_c_with_cudd/
RUN cd frama_c_with_cudd && make opam-install-frama-c-with-cudd
# Install Codex
COPY --chown=ocaml:ocaml . /home/ocaml/codex
RUN cd codex && opam exec -- dune build -p codex
RUN cd codex/frama-c && opam exec -- dune build --profile staticrelease frama_c_codex.exe
RUN cd codex && opam exec -- dune build --profile staticrelease binsec/binsec_codex.exe
# Local Variables:
# mode: shell-script
# End: