Commit aff3546b authored by Philipp  Trunschke's avatar Philipp Trunschke

add Dockerfiles

parent 7c0acdc3
FROM firemarmot/xerus AS xerus
FROM quay.io/fenicsproject/stable:2017.1.0
USER root
WORKDIR "/tmp/"
# Non-Python utilities and libraries
RUN apt-get -qq update && \
apt-get -y install \
libboost-filesystem-dev \
libboost-system-dev \
libboost-python-dev \
liblapack* \
libopenblas-dev \
libiberty-dev \
binutils-dev \
zlib1g-dev
# Install Python2 based environment
RUN apt-get -y install \
python-dev \
python-numpy
# Clean apt
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=xerus /usr/local/include/suitesparse /usr/local/include/suitesparse
COPY --from=xerus /usr/local/lib/suitesparse /usr/local/lib/suitesparse
COPY --from=xerus /usr/local/include/xerus.h /usr/local/include
COPY --from=xerus /usr/local/include/xerus /usr/local/include
COPY --from=xerus /usr/local/lib/libxerus_misc.so /usr/local/lib
COPY --from=xerus /usr/local/lib/libxerus.so /usr/local/lib
COPY --from=xerus /usr/local/lib/python2.7/site-packages/xerus.so /usr/local/lib/python2.7/site-packages
ENV LD_LIBRARY_PATH "/usr/local/lib/:/usr/local/lib/suitesparse:$LD_LIBRARY_PATH"
ENV PYTHONPATH "/usr/local/lib/python2.7/site-packages/:$PYTHONPATH"
# Install custom Python2 packages
RUN pip install cython && pip install ttpy matplotlib2tikz joblib
WORKDIR "/home/fenics/"
USER root
FROM phusion/baseimage:0.9.22
USER root
WORKDIR "/tmp/"
# Get Ubuntu updates
RUN apt-get -qq update && \
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confold" upgrade
# Set locale environment
RUN apt-get -y install locales sudo && \
echo "C.UTF-8 UTF-8" > /etc/locale.gen && \
locale-gen
ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8
# Turn off forwarding of syslog messages to stdout
# https://github.com/phusion/baseimage-docker/issues/186
RUN touch /etc/service/syslog-forwarder/down
# Non-Python utilities and libraries
RUN apt-get -y install \
cmake \
doxygen \
g++ \
gfortran \
git \
libboost-filesystem-dev \
libboost-system-dev \
libboost-python-dev \
liblapack* \
libopenblas-dev \
libiberty-dev \
binutils-dev \
zlib1g-dev
# Install Python2 based environment
RUN apt-get -y install \
python-dev \
python-numpy
# Clean apt
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Get number of physical cores to use
RUN lscpu | grep '^CPU(s)' | awk '{print $2}' > NCORES
RUN echo $(($(cat NCORES)-1)) > NCORES_1
#!/bin/bash
DIRNAME=$(dirname $0)
docker build -t firemarmot/base $DIRNAME/base
docker build -t firemarmot/suitesparse $DIRNAME/suitesparse
docker build -t firemarmot/xerus $DIRNAME/xerus
docker build -t firemarmot $DIRNAME
FROM firemarmot/base
USER root
WORKDIR "/tmp/"
# RUN apt-get update
# RUN apt-get install libsuitesparse-dev
# Install Suitesparse
RUN git clone https://github.com/jluttine/suitesparse.git
WORKDIR "/tmp/suitesparse/"
RUN make install -j $(cat /tmp/NCORES_1) && \
mv include /usr/local/include/suitesparse && \
mv lib/ /usr/local/lib/suitesparse
#TODO: mal sehen, ob das funktioniet...
ENV LD_LIBRARY_PATH "/usr/local/lib/suitesparse:$LD_LIBRARY_PATH"
FROM firemarmot/suitesparse
USER root
WORKDIR "/tmp/"
# Install Xerus
RUN git clone https://git.hemio.de/xerus/xerus.git
WORKDIR "/tmp/xerus/"
RUN git checkout development && \
cp config.mk.default config.mk && \
sed -i "s|# BUILD_PYTHON_BINDINGS = TRUE|BUILD_PYTHON_BINDINGS = TRUE|g" config.mk && \
sed -i "s|HIGH_OPTIMIZATION = TRUE|# HIGH_OPTIMIZATION = TRUE|g" config.mk && \
sed -i "s|#INSTALL_LIB_PATH = /usr/local/lib64/|INSTALL_LIB_PATH = /usr/local/lib/|g" config.mk && \
sed -i "s|#INSTALL_HEADER_PATH = /usr/local/include/|INSTALL_HEADER_PATH = /usr/local/include/|g" config.mk && \
sed -i "s|#INSTALL_PYTHON_PATH = /usr/local/lib64/python2.7/site-packages/|INSTALL_PYTHON_PATH = /usr/local/lib/python2.7/site-packages|g" config.mk && \
sed -i "s|SUITESPARSE = -lcholmod -lspqr|SUITESPARSE = -L/usr/local/lib/suitesparse -lcholmod -lspqr|g" config.mk && \
make install -j $(cat /tmp/NCORES_1)
ENV LD_LIBRARY_PATH "/usr/local/lib/:$LD_LIBRARY_PATH"
ENV PYTHONPATH "/usr/local/lib/python2.7/site-packages/:$PYTHONPATH"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment