summaryrefslogtreecommitdiff
path: root/pkg/docker_bundleapt/Dockerfile
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-02-11 22:31:54 +0100
committerKali Kaneko <kali@leap.se>2018-02-15 16:36:42 +0100
commit03e4bae0942c58344d6021fdaa08342baa7aea3c (patch)
treee9cf6154c44016bdca3c98ed2a4c174b5fb8b972 /pkg/docker_bundleapt/Dockerfile
parentf5839b1938ba7ab96f0d9777520a564975470f51 (diff)
[feat] implement fallback to webkit for bundles
in the end, depending on webengine didn't seem to be such a great idea: it makes bundles more complex, heavy and brittle. I tried compiling qt5 and the maintained qtwebkit fork, but that had also its own set of problems (lastly, pyinstaller didn't work properly; pyqt also adds a lot of garbage even if you disabled lots of modules you don't need). so, this is a fallback to a stretch-based build. it fixes the libGL library by adding the right version into the bundle. in this commit I also add a dockerfile for an image that can build bundles by installing pip dependencies directly in the system. this has the advantage that the build process is very fast, but the downside that a new image needs to be pushed to the registry each time that new dependencies are added; we'll also miss any bug due to introducing new dependncies (but hopefully it will be catched by other steps in the CI). The good side of it is that it reduces the need for some hacks in the build process when bundling from a virtualenv.
Diffstat (limited to 'pkg/docker_bundleapt/Dockerfile')
-rw-r--r--pkg/docker_bundleapt/Dockerfile73
1 files changed, 73 insertions, 0 deletions
diff --git a/pkg/docker_bundleapt/Dockerfile b/pkg/docker_bundleapt/Dockerfile
new file mode 100644
index 00000000..31484156
--- /dev/null
+++ b/pkg/docker_bundleapt/Dockerfile
@@ -0,0 +1,73 @@
+FROM python:2.7-slim-stretch
+MAINTAINER kali <kali@leap.se>
+
+LABEL Description="Image for building Bitmask bundle based on python:2.7-slim-stretch" Vendor="LEAP" Version="1.0"
+
+RUN apt update && apt upgrade -y
+RUN pip install -U pip
+
+# Install bitmask-dev build deps --------------------------------
+RUN apt install -y --no-install-recommends \
+ build-essential virtualenv libpython-dev \
+ libsqlcipher-dev libssl-dev libffi-dev \
+ libsqlite3-dev libzmq3-dev \
+ python-pyqt5 python-pyqt5.qtwebkit \
+ libqt5printsupport5 \
+ qttranslations5-l10n libgl1-mesa-glx \
+ libusb-0.1-4 patchelf wget \
+ gnupg1 git libgl1-mesa-glx
+
+
+# Pyinstaller custom versions
+#ARG PYINSTALLER_TAG=v3.2
+ARG PYINSTALLER_TAG=pyqt5_fix
+#
+# TODO
+# change to pyinstaller repo when pyqt5_fix is merged
+#
+#RUN git clone --depth 1 --single-branch --branch $PYINSTALLER_TAG https://github.com/pyinstaller/pyinstaller.git /tmp/pyinstaller
+RUN git clone --depth 1 --single-branch --branch $PYINSTALLER_TAG https://github.com/bjones1/pyinstaller.git /tmp/pyinstaller
+RUN cd /tmp/pyinstaller && pip install --force-reinstall .
+
+
+# Get Bitmask code --------------------------------------------
+RUN mkdir -p /src/leap
+WORKDIR /src/leap
+
+#ARG BITMASK_BRANCH=master
+#ARG BITMASK_REPO=https://0xacab.org/leap/bitmask-dev
+ARG BITMASK_BRANCH=feat/webkit-fallback
+ARG BITMASK_REPO=https://0xacab.org/kali/bitmask-dev
+#RUN git clone https://0xacab.org/leap/bitmask-dev
+RUN git clone --depth 1 --single-branch --branch $BITMASK_BRANCH $BITMASK_REPO
+
+WORKDIR /src/leap/bitmask-dev
+RUN pip install pysqlcipher --install-option="--bundled"
+RUN pip install leap.bitmask_js
+RUN pip install -r pkg/requirements.pip
+
+RUN pip install ".[mail]"
+RUN make install_pixelated
+
+# TODO -- build on different containers and orchestrate them
+# build gnupg and openvpn binaries --------------------------
+# RUN cd pkg/thirdparty/gnupg && ./build_gnupg.sh
+# RUN cd pkg/thirdparty/openvpn && ./build_openvpn.sh
+# -----------------------------------------------------------
+
+
+# Some hacks to make dist-packages visible from the pip installation path in /usr/local
+RUN ln -s /usr/lib/python2.7/dist-packages/PyQt5/ /usr/local/lib/python2.7/site-packages/PyQt5
+RUN cd /usr/local/lib/python2.7/site-packages/PyQt5 && ln -s QtCore.x86_64-linux-gnu.so QtCore.so
+RUN cd /usr/local/lib/python2.7/site-packages/PyQt5 && ln -s QtGui.x86_64-linux-gnu.so QtGui.so
+RUN cd /usr/local/lib/python2.7/site-packages/PyQt5 && ln -s QtWidgets.x86_64-linux-gnu.so QtWidgets.so
+RUN cd /usr/local/lib/python2.7/site-packages/PyQt5 && ln -s QtWebKit.x86_64-linux-gnu.so QtWebKit.so
+RUN cd /usr/local/lib/python2.7/site-packages/PyQt5 && ln -s QtWebKitWidgets.x86_64-linux-gnu.so QtWebKitWidgets.so
+RUN cd /usr/local/lib/python2.7/site-packages/PyQt5 && ln -s QtNetwork.x86_64-linux-gnu.so QtNetwork.so
+RUN cd /usr/local/lib/python2.7/site-packages/PyQt5 && ln -s QtPrintSupport.x86_64-linux-gnu.so QtPrintSupport.so
+RUN ln -s /usr/lib/python2.7/dist-packages/sip.x86_64-linux-gnu.so /usr/local/lib/python2.7/site-packages/sip.so
+RUN ln -s /usr/lib/python2.7/dist-packages/sipconfig.py /usr/local/lib/python2.7/site-packages/
+RUN ln -s /usr/lib/python2.7/dist-packages/sipconfig_nd.py /usr/local/lib/python2.7/site-packages/
+RUN ln -s /usr/lib/python2.7/dist-packages/sip.pyi /usr/local/lib/python2.7/site-packages/
+
+RUN apt-get install bash