-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
58 lines (46 loc) · 1.48 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM ubuntu:18.04
# Avoid user interaction dialog
ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update
# Binder fails with Cython from pip -> use apt cython3
RUN apt install -y git python3 python3-pip gcc psutils cmake wget make cython3
RUN apt install -y gfortran libblas-dev liblapack-dev python3-tk sudo fonts-lato
RUN pip3 install pip -U
RUN pip3 install matplotlib pytest scipy psutil pyvtk ipywidgets -U
RUN pip3 install --no-cache-dir notebook
RUN ln -s /usr/bin/python3 /usr/bin/python
WORKDIR /usr/local
RUN git clone https://github.com/computationalmodelling/fidimag.git
WORKDIR /usr/local/fidimag
# Work with stable release
RUN git checkout tags/v3.0a2
# Install CVODE and FFTW libraries
WORKDIR /usr/local/fidimag/bin
RUN bash install-fftw.sh
RUN bash install-sundials.sh
ENV PYTHONPATH="/usr/local/fidimag:$PYTHONPATH"
ENV LD_LIBRARY_PATH="/usr/local/fidimag/local/lib:$LD_LIBRARY_PATH"
WORKDIR /usr/local/fidimag
RUN python3 setup.py build_ext --inplace
RUN python3 -c "import matplotlib"
# Headless Matplotlib:
ENV MPLBACKEND=Agg
# Headless Matplotlib:
ENV MPLBACKEND=Agg
# Set threads for OpenMP:
ENV OMP_NUM_THREADS=2
# WORKDIR /io
# User to make Binder happy
ENV NB_USER magnetism
ENV NB_UID 1000
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
# Make sure the contents of our repo are in ${HOME}
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}
WORKDIR /home/${USER}/magnetism/doc/ipynb