|
| 1 | +FROM phusion/baseimage:0.9.19 |
| 2 | + |
| 3 | +# Get Ubuntu updates |
| 4 | +USER root |
| 5 | +RUN apt-get update -q && \ |
| 6 | + apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \ |
| 7 | + apt-get -y install sudo && \ |
| 8 | + apt-get -y install locales && \ |
| 9 | + echo "C.UTF-8 UTF-8" > /etc/locale.gen && \ |
| 10 | + locale-gen && \ |
| 11 | + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 12 | + |
| 13 | +# Set locale environment |
| 14 | +ENV LC_ALL=C.UTF-8 \ |
| 15 | + LANG=C.UTF-8 \ |
| 16 | + LANGUAGE=C.UTF-8 |
| 17 | + |
| 18 | +# OpenBLAS threads should be 1 to ensure performance |
| 19 | +RUN echo 1 > /etc/container_environment/OPENBLAS_NUM_THREADS && \ |
| 20 | + echo 0 > /etc/container_environment/OPENBLAS_VERBOSE |
| 21 | + |
| 22 | + |
| 23 | +# Set up user so that we do not run as root |
| 24 | +RUN useradd -m -s /bin/bash -G sudo,docker_env PyGeM && \ |
| 25 | + echo "PyGeM:docker" | chpasswd && \ |
| 26 | + echo "PyGeM ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers |
| 27 | + |
| 28 | +RUN touch /etc/service/syslog-forwarder/down |
| 29 | +COPY set-home-permissions.sh /etc/my_init.d/set-home-permissions.sh |
| 30 | +RUN chmod +x /etc/my_init.d/set-home-permissions.sh |
| 31 | + |
| 32 | +USER PyGeM |
| 33 | +ENV HOME /home/PyGeM |
| 34 | +RUN touch $HOME/.sudo_as_admin_successful && \ |
| 35 | + mkdir $HOME/shared && \ |
| 36 | + mkdir $HOME/build |
| 37 | +VOLUME /home/PyGeM/shared |
| 38 | + |
| 39 | +WORKDIR /home/PyGeM |
| 40 | +ENTRYPOINT ["sudo","/sbin/my_init","--quiet","--","sudo","-u","PyGeM","/bin/bash","-l","-c"] |
| 41 | +CMD ["/bin/bash","-i"] |
| 42 | + |
| 43 | +# utilities and libraries |
| 44 | +USER root |
| 45 | +RUN apt-get update -y; apt-get install -y --force-yes --fix-missing --no-install-recommends curl git unzip tree subversion vim cmake bison g++ gfortran openmpi-bin pkg-config wget libpcre3-dev bison flex swig libglu1-mesa pyqt4-dev-tools |
| 46 | +RUN apt-get clean && \ |
| 47 | + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 48 | + |
| 49 | +RUN id PyGeM |
| 50 | +RUN chown -R PyGeM:PyGeM $HOME |
| 51 | + |
| 52 | +RUN cd /tmp && \ |
| 53 | + wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh && \ |
| 54 | + chmod +x miniconda.sh && \ |
| 55 | + bash miniconda.sh -b -p /usr/local/miniconda && \ |
| 56 | + rm /tmp/* |
| 57 | +ENV PATH=/usr/local/miniconda/bin:$PATH |
| 58 | + |
| 59 | +RUN echo "PATH=/usr/local/miniconda/bin:$PATH" >> ~/.profile |
| 60 | +RUN /bin/bash -c 'source ~/.profile' |
| 61 | + |
| 62 | +RUN hash -r && \ |
| 63 | + conda config --set always_yes yes --set changeps1 no && \ |
| 64 | + conda update -q conda |
| 65 | +RUN conda info -a && \ |
| 66 | + conda create --yes -n test python="2.7"; |
| 67 | + |
| 68 | +RUN /bin/bash -c 'source activate test' |
| 69 | +# The default sip version has api that is not compatible with qt4. |
| 70 | +RUN conda install --yes numpy scipy matplotlib pip nose vtk sip=4.18 |
| 71 | +RUN conda install --yes -c https://conda.anaconda.org/dlr-sc pythonocc-core &&\ |
| 72 | + pip install setuptools && \ |
| 73 | + pip install enum34 && \ |
| 74 | + pip install numpy-stl && \ |
| 75 | + pip install coveralls && \ |
| 76 | + pip install coverage |
| 77 | + |
| 78 | +RUN cd $HOME && \ |
| 79 | + cd build && \ |
| 80 | + git clone https://github.com/mathLab/PyGeM.git && \ |
| 81 | + cd PyGeM && \ |
| 82 | + python setup.py install |
| 83 | + |
| 84 | +USER PyGeM |
| 85 | + |
| 86 | + |
0 commit comments