| 1 | ###
|
|---|
| 2 | ### BUILD1 STAGE
|
|---|
| 3 | ###
|
|---|
| 4 | FROM ubuntu:18.04 AS build-boost-stage
|
|---|
| 5 | WORKDIR /home/molecuilder
|
|---|
| 6 |
|
|---|
| 7 | # add all packages for boost
|
|---|
| 8 | RUN apt-get update && apt-get install -y \
|
|---|
| 9 | bzip2 \
|
|---|
| 10 | cmake \
|
|---|
| 11 | g++ \
|
|---|
| 12 | git \
|
|---|
| 13 | libbz2-dev \
|
|---|
| 14 | libgsl0-dev \
|
|---|
| 15 | libblas-dev \
|
|---|
| 16 | libpython3-dev \
|
|---|
| 17 | libcppunit-dev \
|
|---|
| 18 | python3-dev \
|
|---|
| 19 | python3-numpy \
|
|---|
| 20 | wget \
|
|---|
| 21 | && rm -rf /var/lib/apt-get/lists/*
|
|---|
| 22 | # link pyconfig-config as it's used by both boost's bootstrap and boost.m4 to find python
|
|---|
| 23 | # RUN ln -s /usr/bin/python3.6-config /usr/bin/python-config
|
|---|
| 24 |
|
|---|
| 25 | # compile boost libs
|
|---|
| 26 | ADD boost_1_69_0.tar.bz2 .
|
|---|
| 27 | RUN (cd boost_1_69_0 && \
|
|---|
| 28 | echo "# Configure specific Python version.\nusing python : 3.6m : /usr/bin/python3.6m : /usr/include/python3.6m : /usr/lib/x86_64-linux-gnu ;\n\nusing mpi ;" >user-config.jam && \
|
|---|
| 29 | ./bootstrap.sh && \
|
|---|
| 30 | ./b2 \
|
|---|
| 31 | -j8 \
|
|---|
| 32 | --build-type=complete \
|
|---|
| 33 | --build-dir=build64 \
|
|---|
| 34 | --layout=tagged \
|
|---|
| 35 | --prefix=/home/molecuilder/_pkgs/boost-1.69 \
|
|---|
| 36 | --user-config=user-config.jam \
|
|---|
| 37 | variant=release \
|
|---|
| 38 | threading=multi \
|
|---|
| 39 | install)
|
|---|
| 40 | RUN rm -rf boost_1_69_0.tar.bz2
|
|---|
| 41 |
|
|---|
| 42 | # build molecuilder
|
|---|
| 43 | ###
|
|---|
| 44 | ### BUILD2 STAGE
|
|---|
| 45 | ###
|
|---|
| 46 | FROM ubuntu:18.04 as build-molecuilder-stage
|
|---|
| 47 | WORKDIR /home/molecuilder
|
|---|
| 48 | ENV MOLECUILDER_VERSION 1.6.1
|
|---|
| 49 |
|
|---|
| 50 | # copy build boost
|
|---|
| 51 | COPY --from=build-boost-stage /home/molecuilder/_pkgs /home/molecuilder/_pkgs
|
|---|
| 52 |
|
|---|
| 53 | # add all packages for boost
|
|---|
| 54 | RUN apt-get update && apt-get install -y \
|
|---|
| 55 | bzip2 \
|
|---|
| 56 | cmake \
|
|---|
| 57 | g++ \
|
|---|
| 58 | git \
|
|---|
| 59 | libbz2-dev \
|
|---|
| 60 | libgsl0-dev \
|
|---|
| 61 | libblas-dev \
|
|---|
| 62 | libpython3-dev \
|
|---|
| 63 | libcppunit-dev \
|
|---|
| 64 | python3-dev \
|
|---|
| 65 | wget \
|
|---|
| 66 | && rm -rf /var/lib/apt-get/lists/*
|
|---|
| 67 | # link pyconfig-config as it's used by both boost's bootstrap and boost.m4 to find python
|
|---|
| 68 | RUN ln -s /usr/bin/python3.6-config /usr/bin/python-config
|
|---|
| 69 | RUN ln -s /home/molecuilder/_pkgs/boost-1.69/lib/libboost_python36-mt-x64.so /home/molecuilder/_pkgs/boost-1.69/lib/libboost_python-mt-x64.so
|
|---|
| 70 | RUN ln -s /home/molecuilder/_pkgs/boost-1.69/lib/libboost_numpy36-mt-x64.so /home/molecuilder/_pkgs/boost-1.69/lib/libboost_numpy3-mt-x64.so
|
|---|
| 71 |
|
|---|
| 72 | ENV ARCHIVE molecuilder-1.6.1.tar.bz2
|
|---|
| 73 | COPY dependencies_ubuntu18_04.txt .
|
|---|
| 74 | RUN apt-get update && apt-get install -y \
|
|---|
| 75 | `cat dependencies_ubuntu18_04.txt` \
|
|---|
| 76 | && rm -rf /var/lib/apt-get/lists/*
|
|---|
| 77 | # update locate db, otherwise pyconfig.h is not found
|
|---|
| 78 | RUN updatedb
|
|---|
| 79 | COPY libqt4-3d*.deb ./
|
|---|
| 80 | RUN dpkg -i libqt4-3d-dev_1.0-tp2_amd64.deb libqt4-3d_1.0-tp2_amd64.deb
|
|---|
| 81 | COPY $ARCHIVE .
|
|---|
| 82 | #RUN (GIT_SSL_NO_VERIFY=true git clone -b stable https://molecuilder.t3m4.net/git/molecuilder.git molecuilder && \
|
|---|
| 83 | #RUN (cd molecuilder && \
|
|---|
| 84 | # git checkout v$MOLECUILDER_VERSION && \
|
|---|
| 85 | # ./bootstrap)
|
|---|
| 86 | RUN (cp `basename $ARCHIVE` `basename $ARCHIVE | sed -e "s#-#_#" -e "s#\(\.tar\.${suffix}\)#.orig\1#"`)
|
|---|
| 87 | RUN ( tar -jxvf $ARCHIVE && \
|
|---|
| 88 | cd molecuilder-1.6.1 && \
|
|---|
| 89 | mkdir -p build64 && \
|
|---|
| 90 | cd build64 && \
|
|---|
| 91 | ../configure \
|
|---|
| 92 | -C \
|
|---|
| 93 | 'PKG_CONFIG_PATH=' \
|
|---|
| 94 | 'BOOST_PYTHON_CONFIG=/usr/bin/python3-config' \
|
|---|
| 95 | '--with-boost=/home/molecuilder/_pkgs/boost-1.69' \
|
|---|
| 96 | '--enable-jobmarket' \
|
|---|
| 97 | '--enable-python' \
|
|---|
| 98 | '--enable-qtgui' \
|
|---|
| 99 | '--disable-qwt' \
|
|---|
| 100 | '--enable-vmg' \
|
|---|
| 101 | '--with-vmg-mpi' \
|
|---|
| 102 | '--enable-levmar' \
|
|---|
| 103 | '--disable-valgrind' \
|
|---|
| 104 | '--enable-action-thread' \
|
|---|
| 105 | '--disable-debug' \
|
|---|
| 106 | 'CXXFLAGS=-Wall -g0 -O3' \
|
|---|
| 107 | 'CXX=mpic++' 'CC=mpicc' 'FC=mpif90' \
|
|---|
| 108 | '--disable-qtgui-capture-log' \
|
|---|
| 109 | '--with-default-parallel=none' \
|
|---|
| 110 | 'PYTHON=/usr/bin/python3' \
|
|---|
| 111 | 'QT_CFLAGS=-I/usr/share/qt4/include -I/usr/share/qt4/include/Qt -I/usr/share/qt4/include/QtCore -I/usr/share/qt4/include/QtGui' \
|
|---|
| 112 | 'QT_LDFLAGS=-L/usr/lib/x86_64-linux-gnu -L/usr/lib' \
|
|---|
| 113 | 'QT_LIBS=-lQtCore -lQtGui -lQtOpenGL -lQt3D' \
|
|---|
| 114 | '--prefix=/home/molecuilder/_pkgs/molecuilder-1.6.1')
|
|---|
| 115 | RUN (cd molecuilder-1.6.1/build64 && \
|
|---|
| 116 | make -j8 && \
|
|---|
| 117 | make install)
|
|---|
| 118 | #RUN (cd molecuilder-1.6.1/ && \
|
|---|
| 119 | # debuild -j6 -ub -uc)
|
|---|
| 120 | #RUN mv molecuilder-1.6.1/build64/*.deb . && \
|
|---|
| 121 | # rm -rf molecuilder
|
|---|
| 122 |
|
|---|
| 123 | ###
|
|---|
| 124 | ### DEPLOY STAGE
|
|---|
| 125 | ###
|
|---|
| 126 | FROM ubuntu:18.04
|
|---|
| 127 | WORKDIR /home/molecuilder
|
|---|
| 128 |
|
|---|
| 129 | RUN apt-get -y update && apt-get install -y \
|
|---|
| 130 | iproute2 \
|
|---|
| 131 | libblas3 \
|
|---|
| 132 | libgfortran3 \
|
|---|
| 133 | libglvnd0 \
|
|---|
| 134 | libgsl23 \
|
|---|
| 135 | liblapack3 \
|
|---|
| 136 | libopenmpi-dev \
|
|---|
| 137 | libpython3.6-minimal \
|
|---|
| 138 | libqt4-opengl \
|
|---|
| 139 | libqtcore4 \
|
|---|
| 140 | libqtgui4 \
|
|---|
| 141 | libqwt5-qt4 \
|
|---|
| 142 | mpi-default-bin \
|
|---|
| 143 | openmpi-bin \
|
|---|
| 144 | openmpi-common \
|
|---|
| 145 | python3 \
|
|---|
| 146 | python3-pip \
|
|---|
| 147 | units \
|
|---|
| 148 | mesa-utils \
|
|---|
| 149 | libgl1-mesa-glx
|
|---|
| 150 | COPY --from=build-molecuilder-stage /home/molecuilder/_pkgs ./_pkgs
|
|---|
| 151 | COPY libqt4-3d_1.0-tp2_amd64.deb /tmp
|
|---|
| 152 | COPY run_poolworker.sh /tmp
|
|---|
| 153 | RUN dpkg -i /tmp/libqt4-3d_1.0-tp2_amd64.deb && \
|
|---|
| 154 | rm -f /tmp/libqt4-3d_1.0-tp2_amd64.deb
|
|---|
| 155 | ENV OMPI_MCA_plm_rsh_agent /bin/false
|
|---|
| 156 | ENV PATH "$PATH:/home/molecuilder/_pkgs/molecuilder-1.6.1"
|
|---|
| 157 |
|
|---|
| 158 | # install for taking screenshots
|
|---|
| 159 | RUN /usr/bin/python3 -m pip install pyscreenshot
|
|---|
| 160 | RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive TZ="Europe/Amsterdam" apt-get -y install tzdata
|
|---|
| 161 | RUN apt -y install libjpeg9-dev zlibc zlib1g-dev gnome-screenshot python3-tk
|
|---|
| 162 | RUN /usr/bin/python3 -m pip install pyautogui
|
|---|
| 163 |
|
|---|
| 164 | RUN mkdir -p /tmp/molecuilder
|
|---|
| 165 |
|
|---|
| 166 | # allow OpenGL to work in dockerized container (start with --privileged)
|
|---|
| 167 | ENV NVIDIA_DRIVER_CAPABILITIES all
|
|---|
| 168 | ENV QT_X11_NO_MITSHM=1
|
|---|
| 169 | EnV LIBGL_ALWAYS_INDIRECT=1
|
|---|