Dockerfile 1.98 KB
Newer Older
1
FROM debian:buster as base
2

3
# Install non-OCaml dependencies + opam
4
5
6
7
8
9
RUN apt-get update && apt-get install -y \
    cvc4 \
    opam \
    z3 \
    && rm -rf /var/lib/apt/lists/*

10
11
12
13
14
15
16
17
18
RUN opam init --disable-sandboxing --compiler=ocaml-base-compiler.4.07.1 -y

# "RUN eval $(opam env)" does not work, so we manually set its variables
ENV OPAM_SWITCH_PREFIX "/root/.opam/ocaml-base-compiler.4.07.1"
ENV CAML_LD_LIBRARY_PATH "/root/.opam/ocaml-base-compiler.4.07.1/lib/stublibs:/root/.opam/ocaml-base-compiler.4.07.1/lib/ocaml/stublibs:/root/.opam/ocaml-base-compiler.4.07.1/lib/ocaml"
ENV OCAML_TOPLEVEL_PATH "/root/.opam/ocaml-base-compiler.4.07.1/lib/toplevel"
ENV MANPATH "$MANPATH:/root/.opam/ocaml-base-compiler.4.07.1/man"
ENV PATH "/root/.opam/ocaml-base-compiler.4.07.1/bin:$PATH"

19
RUN opam update -y && opam install depext -y
20
21

# Install packages from reference configuration
22
RUN apt-get update && opam update -y && opam depext --install -y --verbose \
23
24
25
26
27
28
29
30
31
32
33
    alt-ergo.2.0.0 \
    apron.v0.9.12 \
    conf-graphviz.0.1 \
    mlgmpidl.1.2.12 \
    ocamlfind.1.8.0 \
    ocamlgraph.1.8.8 \
    ppx_deriving_yojson.3.5.2 \
    why3.1.3.1 \
    yojson.1.7.0 \
    zarith.1.9.1 \
    zmq.5.1.3 \
34
35
    && rm -rf /var/lib/apt/lists/*

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
RUN why3 config --full-config

# with_source: keep Frama-C sources
ARG with_source=no

RUN cd /root && \
    wget http://frama-c.com/download/frama-c-21.0-Scandium.tar.gz && \
    tar xvf frama-c-*.tar.gz && \
    (cd frama-c-* && \
        ./configure --disable-gui && \
        make -j && \
        make install \
    ) && \
    rm -f frama-c-*.tar.gz && \
    [ "${with_source}" != "no" ] || rm -rf frama-c-*

# with_test: run Frama-C tests; requires "with_source=yes"
ARG with_test=no

RUN if [ "${with_test}" != "no" ]; then \
56
57
       apt-get update && \
       opam update -y && opam depext --install -y \
58
59
60
61
           conf-python-3.1.0.0 \
           conf-time.1 \
           --verbose \
        && \
62
        rm -rf /var/lib/apt/lists/* && \
63
64
65
        cd /root/frama-c-* && \
        make tests; \
    fi