source: docker/Dockerfile@ 91c409

Candidate_v1.7.0 stable
Last change on this file since 91c409 was 5e0f64, checked in by Frederik Heber <frederik.heber@…>, 3 months ago

Added dockerfile to repository and how to build it.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1###
2### BUILD1 STAGE
3###
4FROM ubuntu:18.04 AS build-boost-stage
5WORKDIR /home/molecuilder
6
7# add all packages for boost
8RUN 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
26ADD boost_1_69_0.tar.bz2 .
27RUN (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)
40RUN rm -rf boost_1_69_0.tar.bz2
41
42# build molecuilder
43###
44### BUILD2 STAGE
45###
46FROM ubuntu:18.04 as build-molecuilder-stage
47WORKDIR /home/molecuilder
48ENV MOLECUILDER_VERSION 1.6.1
49
50# copy build boost
51COPY --from=build-boost-stage /home/molecuilder/_pkgs /home/molecuilder/_pkgs
52
53# add all packages for boost
54RUN 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
68RUN ln -s /usr/bin/python3.6-config /usr/bin/python-config
69RUN 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
70RUN 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
72ENV ARCHIVE molecuilder-1.6.1.tar.bz2
73COPY dependencies_ubuntu18_04.txt .
74RUN 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
78RUN updatedb
79COPY libqt4-3d*.deb ./
80RUN dpkg -i libqt4-3d-dev_1.0-tp2_amd64.deb libqt4-3d_1.0-tp2_amd64.deb
81COPY $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)
86RUN (cp `basename $ARCHIVE` `basename $ARCHIVE | sed -e "s#-#_#" -e "s#\(\.tar\.${suffix}\)#.orig\1#"`)
87RUN ( 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')
115RUN (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###
126FROM ubuntu:18.04
127WORKDIR /home/molecuilder
128
129RUN 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
150COPY --from=build-molecuilder-stage /home/molecuilder/_pkgs ./_pkgs
151COPY libqt4-3d_1.0-tp2_amd64.deb /tmp
152COPY run_poolworker.sh /tmp
153RUN dpkg -i /tmp/libqt4-3d_1.0-tp2_amd64.deb && \
154 rm -f /tmp/libqt4-3d_1.0-tp2_amd64.deb
155ENV OMPI_MCA_plm_rsh_agent /bin/false
156ENV PATH "$PATH:/home/molecuilder/_pkgs/molecuilder-1.6.1"
157
158# install for taking screenshots
159RUN /usr/bin/python3 -m pip install pyscreenshot
160RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive TZ="Europe/Amsterdam" apt-get -y install tzdata
161RUN apt -y install libjpeg9-dev zlibc zlib1g-dev gnome-screenshot python3-tk
162RUN /usr/bin/python3 -m pip install pyautogui
163
164RUN mkdir -p /tmp/molecuilder
165
166# allow OpenGL to work in dockerized container (start with --privileged)
167ENV NVIDIA_DRIVER_CAPABILITIES all
168ENV QT_X11_NO_MITSHM=1
169EnV LIBGL_ALWAYS_INDIRECT=1
Note: See TracBrowser for help on using the repository browser.