forked from goblint/analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (30 loc) · 1.4 KB
/
Dockerfile
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
# dev stage: development environment with opam, ocaml and dependencies
# just -opam tag because make setup will install ocaml compiler
FROM ocaml/opam:ubuntu-21.04-opam AS dev
# copy only files for make setup to cache docker layers without code changes
COPY --chown=opam Makefile make.sh goblint.opam goblint.opam.locked /home/opam/analyzer/
WORKDIR /home/opam/analyzer/
# TODO: use opam depext
RUN sudo apt-get update \
&& sudo apt-get install -y libgmp-dev libmpfr-dev pkg-config autoconf
# update local opam repository because base image may be outdated
RUN cd /home/opam/opam-repository \
&& git pull origin master \
&& opam update
RUN make setup
# copy the rest
COPY --chown=opam . /home/opam/analyzer
RUN make
# relocatable stage: relocatable installation with only runtime dependencies
FROM dev AS relocatable
RUN sudo apt-get install -y chrpath
RUN make relocatable
# final stage: minimal run environment for small docker image
FROM ubuntu:21.04
# cannot use opam depext because no opam here, also additional preprocessing/header dependencies
# libgmp for zarith, libmpfr for apron, cpp for preprocessing, libc6 for pthread.h, libgcc for stddef.h
RUN apt-get update \
&& apt-get install -y libgmp-dev libmpfr-dev cpp libc6-dev libgcc-10-dev \
&& rm -rf /var/lib/apt/lists/*
COPY --from=relocatable /home/opam/analyzer/relocatable /opt/goblint/analyzer
ENTRYPOINT ["/opt/goblint/analyzer/bin/goblint"]