|
| 1 | +# Set the base image |
| 2 | +FROM debian:8 |
| 3 | + |
| 4 | +WORKDIR /tmp |
| 5 | + |
| 6 | +RUN mkdir -p /opt/mlc-python-2.7.11/bin /tmp/MLC /tmp/Scripts |
| 7 | + |
| 8 | +# Create project structure |
| 9 | +ADD mlc_python_scripts/* /opt/mlc-python-2.7.11/bin/ |
| 10 | + |
| 11 | +# Update the current system |
| 12 | +RUN apt-get update && apt-get upgrade -y |
| 13 | + |
| 14 | +# Install packages |
| 15 | +RUN apt-get install cmake \ |
| 16 | + liblapack-dev \ |
| 17 | + gfortran \ |
| 18 | + libxml2-dev \ |
| 19 | + libxslt1-dev \ |
| 20 | + libshiboken-dev \ |
| 21 | + ruby-dev \ |
| 22 | + tcl-dev \ |
| 23 | + tcl \ |
| 24 | + tk \ |
| 25 | + tk-dev \ |
| 26 | + ssh \ |
| 27 | + gcc \ |
| 28 | + g++ \ |
| 29 | + wget \ |
| 30 | + xz-utils \ |
| 31 | + make \ |
| 32 | + vim \ |
| 33 | + libssl-dev \ |
| 34 | + libsqlite3-dev \ |
| 35 | + git \ |
| 36 | + freeglut3 \ |
| 37 | + freeglut3-dev \ |
| 38 | + binutils-gold \ |
| 39 | + libglew-dev \ |
| 40 | + mesa-common-dev \ |
| 41 | + build-essential \ |
| 42 | + '^libxcb.*-dev' \ |
| 43 | + libx11-xcb-dev \ |
| 44 | + libglu1-mesa-dev \ |
| 45 | + libxrender-dev \ |
| 46 | + libxi-dev \ |
| 47 | + libxkbcommon-dev \ |
| 48 | + libreadline5 \ |
| 49 | + libreadline6 \ |
| 50 | + libreadline6-dev \ |
| 51 | + libreadline-dev \ |
| 52 | + rubygems \ |
| 53 | + -y |
| 54 | + |
| 55 | +# Download python 2.7.11 |
| 56 | +# For more information about the compilation of the Python: http://www.mathworks.com/help/matlab/matlab_external/system-requirements-for-matlab-engine-for-python.html?requestedDomain=www.mathworks.com |
| 57 | +RUN wget -q https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tar.xz && \ |
| 58 | + tar xJvf Python-2.7.11.tar.xz && \ |
| 59 | + cd Python-2.7.11 && ./configure --enable-shared --enable-unicode=ucs4 --prefix=/opt/mlc-python-2.7.11 && make && make install && \ |
| 60 | + rm -rf /tmp/Python-2.7.11* |
| 61 | + |
| 62 | +# Install Python Setuptools |
| 63 | +RUN wget -q https://pypi.python.org/packages/source/s/setuptools/setuptools-20.1.1.tar.gz#md5=10a0f4feb9f2ea99acf634c8d7136d6d && \ |
| 64 | + tar xzvf setuptools-20.1.1.tar.gz && \ |
| 65 | + cd setuptools-20.1.1 && /opt/mlc-python-2.7.11/bin/mlc_python setup.py build && /opt/mlc-python-2.7.11/bin/mlc_python setup.py install && \ |
| 66 | + rm -rf /tmp/setuptools-20.1.1* |
| 67 | + |
| 68 | + |
| 69 | +# Idem with pip |
| 70 | +RUN wget -q https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb && \ |
| 71 | + tar xzvf pip-8.0.2.tar.gz && \ |
| 72 | + cd pip-8.0.2 && /opt/mlc-python-2.7.11/bin/mlc_python setup.py build && /opt/mlc-python-2.7.11/bin/mlc_python setup.py install && \ |
| 73 | + rm -rf /tmp/pip-8.0.2* |
| 74 | + |
| 75 | +# Install Qt5.7 |
| 76 | +RUN git clone git://code.qt.io/qt/qtbase.git && \ |
| 77 | + cd qtbase && \ |
| 78 | + git checkout 5.7 && \ |
| 79 | + ./configure --prefix=/opt/mlc-python-2.7.11/Qt-5.7.1 -xkb-config-root /usr/share/X11/xkb -no-gtk -nomake tests -nomake examples -qt-xcb --opensource --confirm-license && \ |
| 80 | + make -j4 && make install && \ |
| 81 | + rm -rf /tmp/qtbase |
| 82 | + |
| 83 | +RUN git clone git://code.qt.io/qt/qttools.git && \ |
| 84 | + cd qttools && \ |
| 85 | + git checkout 5.7 && \ |
| 86 | + /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \ |
| 87 | + rm -rf /tmp/qttools |
| 88 | + |
| 89 | +RUN git clone git://code.qt.io/qt/qtcharts.git && \ |
| 90 | + cd qtcharts && \ |
| 91 | + git checkout 5.7 && \ |
| 92 | + /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \ |
| 93 | + rm -rf /tmp/qtcharts |
| 94 | + |
| 95 | +RUN git clone git://code.qt.io/qt/qtdatavis3d.git && \ |
| 96 | + cd qtdatavis3d && \ |
| 97 | + git checkout 5.7 && \ |
| 98 | + /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \ |
| 99 | + rm -rf /tmp/qtdatavis3d |
| 100 | + |
| 101 | +RUN git clone git://code.qt.io/qt/qtdeclarative.git && \ |
| 102 | + cd qtdeclarative && \ |
| 103 | + git checkout 5.7 && \ |
| 104 | + /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \ |
| 105 | + rm -rf /tmp/qtdeclarative |
| 106 | + |
| 107 | +RUN git clone git://code.qt.io/qt/qtx11extras.git && \ |
| 108 | + cd qtx11extras && \ |
| 109 | + git checkout 5.7 && \ |
| 110 | + /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake CONFIG+=release && make -j4 && make install && \ |
| 111 | + rm -rf /tmp/qtx11extras |
| 112 | + |
| 113 | +RUN git clone https://github.com/mati75/qt5ct.git && \ |
| 114 | + cd qt5ct && \ |
| 115 | + /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake PREFIX=/opt/mlc-python-2.7.11/qt5ct && make -j4 && make install && \ |
| 116 | + rm -rf /tmp/qt5ct |
| 117 | + |
| 118 | +RUN git clone git://code.qt.io/qt/qtstyleplugins.git && \ |
| 119 | + cd qtstyleplugins && \ |
| 120 | + /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake && make && \ |
| 121 | + mkdir -p /opt/mlc-python-2.7.11/Qt-5.7.1/plugins/styles && \ |
| 122 | + cp -r ./plugins/styles/* /opt/mlc-python-2.7.11/Qt-5.7.1/plugins/styles && \ |
| 123 | + rm -rf /tmp/qtstyleplugins |
| 124 | + |
| 125 | +# Add PyQt5 Support |
| 126 | +RUN wget https://sourceforge.net/projects/pyqt/files/sip/sip-4.19/sip-4.19.tar.gz && \ |
| 127 | + tar xzvf sip-4.19.tar.gz && \ |
| 128 | + cd sip-4.19 && \ |
| 129 | + /opt/mlc-python-2.7.11/bin/mlc_python configure.py && \ |
| 130 | + make -j4 && make install && \ |
| 131 | + rm -rf /tmp/sip-4.19* |
| 132 | + |
| 133 | +RUN wget https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.7.1/PyQt5_gpl-5.7.1.tar.gz && \ |
| 134 | + tar xzvf PyQt5_gpl-5.7.1.tar.gz && \ |
| 135 | + cd PyQt5_gpl-5.7.1 && \ |
| 136 | + /opt/mlc-python-2.7.11/bin/mlc_python configure.py --qmake /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake --confirm-license --sip /opt/mlc-python-2.7.11/bin/sip && \ |
| 137 | + make -j4 && make install && \ |
| 138 | + rm -rf /tmp/PyQt5_gpl-5.7.1* |
| 139 | + |
| 140 | +# Add PyQt5 Charts |
| 141 | +RUN wget https://sourceforge.net/projects/pyqt/files/PyQtChart/PyQtChart-5.7.1/PyQtChart_gpl-5.7.1.tar.gz && \ |
| 142 | + tar xzvf PyQtChart_gpl-5.7.1.tar.gz && \ |
| 143 | + cd PyQtChart_gpl-5.7.1 && \ |
| 144 | + /opt/mlc-python-2.7.11/bin/mlc_python configure.py --qmake /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake --sip /opt/mlc-python-2.7.11/bin/sip && \ |
| 145 | + make -j4 && make install && \ |
| 146 | + rm -rf /tmp/PyQtChart_gpl-5.7.1* |
| 147 | + |
| 148 | +RUN wget https://sourceforge.net/projects/pyqt/files/PyQtDataVisualization/PyQtDataVisualization-5.7.1/PyQtDataVisualization_gpl-5.7.1.tar.gz/download -O PyQtDataVisualization_gpl-5.7.1.tar.gz && \ |
| 149 | + tar xzvf PyQtDataVisualization_gpl-5.7.1.tar.gz && \ |
| 150 | + cd PyQtDataVisualization_gpl-5.7.1 && \ |
| 151 | + /opt/mlc-python-2.7.11/bin/mlc_python configure.py --qmake /opt/mlc-python-2.7.11/Qt-5.7.1/bin/qmake --sip /opt/mlc-python-2.7.11/bin/sip && \ |
| 152 | + make -j4 && make install && \ |
| 153 | + rm -rf /tmp/PyQtDataVisualization_gpl-5.7.1* |
| 154 | + |
| 155 | +# Install mlc dependencies |
| 156 | +# Create .sh who will load the desired enviroment to run nosetests within it |
| 157 | +RUN export LD_LIBRARY_PATH=/usr/local/Qt-5.7.1/lib:$LD_LIBRARY_PATH && \ |
| 158 | + export PATH=/usr/local/Qt-5.7.1/bin:$PATH && \ |
| 159 | + /opt/mlc-python-2.7.11/bin/mlc_pip install ipython numpy flask requests pyserial nose pyyaml coverage matplotlib scipy pyusb |
| 160 | + |
| 161 | +RUN gem install fpm |
| 162 | + |
| 163 | +ARG RELEASE |
| 164 | +ENV RELEASE ${RELEASE} |
| 165 | +ENV OS_VERSION debian-8 |
| 166 | +ENV PACKAGE_TYPE deb |
| 167 | +ADD deploy_scripts/* /tmp/deploy_scripts/ |
| 168 | +ENTRYPOINT ["/tmp/deploy_scripts/create_MLC_folder.sh"] |
0 commit comments