Add a Dockerfile to build a full image of a Nit install
[nit.git] / misc / docker / Dockerfile
1 # This is a full install of Nit on a debian base.
2 # Full because most dependencies are installed so that most tests can be run
3
4 FROM debian:jessie
5 MAINTAINER Jean Privat <jean@pryen.org>
6
7 # Install dependencies
8 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9                 # Recomanded builds pakages
10                 build-essential \
11                 ccache \
12                 libgc-dev \
13                 graphviz \
14                 libunwind-dev \
15                 pkg-config \
16                 # Get the code!
17                 git \
18                 ca-certificates \
19                 curl \
20                 # For nit manpages :)
21                 man \
22         && rm -rf /var/lib/apt/lists/*
23
24 # Clone and compile
25 RUN git clone https://github.com/nitlang/nit.git /root/nit \
26         && cd /root/nit \
27         && make \
28         && . misc/nit_env.sh install \
29         # Clean and reduce size
30         && strip c_src/nitc bin/nit* \
31         && ccache -C \
32         && rm -rf .git
33
34 # Dependencies for more libs and tests
35 RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
36                 # Packages needed for lib/
37                 libcurl4-openssl-dev \
38                 libegl1-mesa-dev \
39                 libevent-dev \
40                 libgles1-mesa-dev \
41                 libgles2-mesa-dev \
42                 libgtk-3-dev \
43                 libncurses5-dev \
44                 libsdl-image1.2-dev \
45                 libsdl-ttf2.0-dev \
46                 libsdl1.2-dev \
47                 libsdl2-dev \
48                 libsqlite3-dev \
49                 libx11-dev \
50                 libxdg-basedir-dev \
51                 # Packages needed for platforms and FFI
52                 default-jdk \
53                 libopenmpi-dev \
54                 clang \
55                 # TODO neo4j android emscripten test_glsl_validation
56         && rm -rf /var/lib/apt/lists/*
57
58 # Run tests
59 RUN cd /root/nit/tests \
60         && ./testfull.sh || true \
61         && rm -rf out/ alt/*.nit \
62         && ccache -C
63 # TODO: nitunits
64
65 WORKDIR /root/nit
66 ENTRYPOINT [ "bash" ]