Dockerfile 1.87 KB
Newer Older
Mohcine Chraibi's avatar
Mohcine Chraibi committed
1 2 3 4 5 6
# -----------------------------------------
# - build:
#   docker build jupedsim/jpscore .
# - run:
#    docker -it jupedsim/jpscore
# -----------------------------------------
Mohcine Chraibi's avatar
Mohcine Chraibi committed
7

Mohcine Chraibi's avatar
Mohcine Chraibi committed
8
FROM ubuntu:18.04
Mohcine Chraibi's avatar
Mohcine Chraibi committed
9

Mohcine Chraibi's avatar
Mohcine Chraibi committed
10 11 12 13 14 15 16 17 18 19
MAINTAINER Mohcine Chraibi <m.chraibi@gmail.com>

# install required packages
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    g++ \
    git \
    lcov \
    doxygen \
20
    wget \
Mohcine Chraibi's avatar
Mohcine Chraibi committed
21
    libbz2-dev \
Mohcine Chraibi's avatar
Mohcine Chraibi committed
22 23 24
    python \
    python-dev \
    python-pip \
Mohcine Chraibi's avatar
Mohcine Chraibi committed
25
    libgmp* \
Mohcine Chraibi's avatar
Mohcine Chraibi committed
26 27 28 29 30
    && apt-get clean

# set environment
ENV HOME /home/jupedsim

31 32 33 34 35 36 37 38 39 40 41 42
ARG boost_version=1.61.0
ARG boost_dir=boost_1_61_0
ENV boost_version ${boost_version}
ENV BOOST_ROOT /usr
RUN wget http://downloads.sourceforge.net/project/boost/boost/${boost_version}/${boost_dir}.tar.gz \
    && tar xfz ${boost_dir}.tar.gz \
    && rm ${boost_dir}.tar.gz \
    && cd ${boost_dir} \
    && ./bootstrap.sh --with-libraries=filesystem,test,system\
    && ./b2 --without-python --prefix=/usr -j 4 link=shared runtime-link=shared install \
    && cd .. && rm -rf ${boost_dir} && ldconfig

Mohcine Chraibi's avatar
Mohcine Chraibi committed
43

Mohcine Chraibi's avatar
Mohcine Chraibi committed
44 45 46 47 48
# add user
RUN groupadd -r -g 1000 jupedsim && useradd -r -g jupedsim -u 1000 -m jupedsim
USER jupedsim

# install jpscore
Mohcine Chraibi's avatar
Mohcine Chraibi committed
49 50 51 52 53
RUN mkdir -p /home/jupedsim/workspace \
    && cd /home/jupedsim/workspace \
    && pwd

# compile cgal
54 55 56 57 58 59
# RUN cd ~ \
#      && wget https://github.com/CGAL/cgal/releases/download/releases%2FCGAL-4.10.2/CGAL-4.10.2.tar.xz \
#      && tar -xJvf CGAL-4.10.2.tar.xz \
#      && cd CGAL-4.10.2 \
#      && cmake . \
#      && make
Mohcine Chraibi's avatar
Mohcine Chraibi committed
60 61


Mohcine Chraibi's avatar
Mohcine Chraibi committed
62
RUN cd /home/jupedsim/workspace \
63
    && git clone --depth=5 https://gitlab.version.fz-juelich.de/jupedsim/jpscore.git \
Mohcine Chraibi's avatar
Mohcine Chraibi committed
64 65 66
    && cd jpscore \
    && mkdir -p build \
    && cd build \
67
    && cmake  ..\
Mohcine Chraibi's avatar
Mohcine Chraibi committed
68 69 70 71 72 73 74 75
    && make

# install python variant filtering dependencies
#RUN pip install numpy
#RUN pip install matplotlib


# by default /bin/bash is executed
76
CMD /bin/bash && echo "Thank you for using JuPedSim/jpscore!"