Commit 923e866c authored by Philipp  Trunschke's avatar Philipp Trunschke

docker: update Dockerfiles

parent dc3bfa64
......@@ -21,10 +21,25 @@ RUN apt-get -y install \
python-dev \
python-numpy
# Install Python3 based environment
RUN apt-get -y install \
python3-dev \
python3-numpy
# Check Python versions
RUN python -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "2.7")'
RUN python3 -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "3.5")'
# Clean apt
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Create directories
RUN mkdir -p /usr/local/lib && \
mkdir -p /usr/local/include && \
mkdir -p /usr/local/lib/python2.7/site-packages && \
mkdir -p /usr/local/lib/python3.5/site-packages
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
......@@ -32,11 +47,18 @@ 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"
COPY --from=xerus /usr/local/lib/python3.5/site-packages/xerus.so /usr/local/lib/python3.5/site-packages
# Install custom Python2 packages
RUN pip install cython && pip install ttpy matplotlib2tikz joblib
# Set environment variables
USER fenics
RUN mkdir -p $(python -m site --user-site) && \
echo /usr/local/lib/python2.7/site-packages/ >$(python -m site --user-site)/xerus.pth && \
mkdir -p $(python3 -m site --user-site) && \
echo /usr/local/lib/python3.5/site-packages/ >$(python3 -m site --user-site)/xerus.pth
ENV LD_LIBRARY_PATH "/usr/local/lib/:/usr/local/lib/suitesparse:$LD_LIBRARY_PATH"
WORKDIR "/home/fenics/"
USER root
......@@ -39,6 +39,11 @@ RUN apt-get -y install \
python-dev \
python-numpy
# Install Python3 based environment
RUN apt-get -y install \
python3-dev \
python3-numpy
# Clean apt
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
......
......@@ -8,7 +8,8 @@ WORKDIR "/tmp/"
# Install Suitesparse
RUN git clone https://github.com/jluttine/suitesparse.git
WORKDIR "/tmp/suitesparse/"
RUN make install -j $(cat /tmp/NCORES_1) && \
RUN git checkout v5.2.0 && \
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...
......
......@@ -2,12 +2,23 @@ FROM firemarmot/suitesparse
USER root
WORKDIR "/tmp/"
# Check Python versions
RUN python -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "2.7")'
RUN python3 -c'import sys; raise SystemExit("{0}.{1}".format(*sys.version_info) != "3.5")'
# Install Xerus
RUN git clone https://git.hemio.de/xerus/xerus.git
WORKDIR "/tmp/xerus/"
RUN git checkout development && \
cp ./docker/xerus/config.mk . && \
mkdir -p /usr/local/lib && \
mkdir -p /usr/local/include && \
mkdir -p /usr/local/lib/python2.7/site-packages && \
mkdir -p /usr/local/lib/python3.5/site-packages && \
make install -j $(cat /tmp/NCORES_1)
RUN mkdir -p $(python -m site --user-site) && \
echo /usr/local/lib/python2.7/site-packages/ >$(python -m site --user-site)/xerus.pth && \
mkdir -p $(python3 -m site --user-site) && \
echo /usr/local/lib/python3.5/site-packages/ >$(python3 -m site --user-site)/xerus.pth
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