Fulcrum/contrib/build/linux/Dockerfile_ub16
Calin Culianu 82d2ea8acc
Upgrade dockerfiles for 18.04 and 16.04 to use gcc-8/g++-8
Hopefully should mean better C++ support, fewer bugs, etc. We were on a
somewhat ancient 7.x series for these static builds.
2022-09-17 20:59:17 -05:00

66 lines
3.8 KiB
Text

# Taken from https://github.com/fffaraz/docker-qt
# Example usage:
# $ docker build --force-rm -t fulcrum-builder/qt:linux_ub16 .
# $ docker run --rm -it -v $(pwd):/work fulcrum-builder/qt:linux_ub16
FROM ubuntu:xenial
LABEL maintainer="Calin Culianu <calin.culianu@gmail.com>"
ENTRYPOINT ["/bin/bash"]
RUN \
apt -qy update && \
apt -qy upgrade && \
apt install -qy software-properties-common && \
add-apt-repository ppa:jonathonf/gcc && \
apt-get update -qy && \
apt -qy install build-essential cmake gdb git iputils-ping nano perl python valgrind wget autoconf pkg-config && \
apt -qy install libbz2-dev zlib1g-dev libssl-dev libnss3-dev libxslt-dev libxml2-dev && \
apt install -qy gcc-8 g++-8 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-8 && \
apt -qy autoremove && \
apt -qy autoclean
RUN \
mkdir -p /opt && \
cd /opt && \
echo "💬 \033[1;36mCloning OpenSSL sources ...\033[0m" && \
git clone https://github.com/openssl/openssl.git openssl-src && \
cd openssl-src && git checkout OpenSSL_1_1_1o && \
echo "💬 \033[1;36mBuilding and installing OpenSSL 1.1.1o ...\033[0m" && \
./config --prefix=/opt/local/openssl no-shared no-tests no-dso no-dynamic-engine && \
make depend && make -j $(nproc) && make install_sw && \
echo "💬 \033[1;36mCleaning up OpenSSL sources ...\033[0m" && \
cd .. && rm -fr openssl-src && \
echo "💬 \033[1;36mDownloading Qt sources ...\033[0m" && \
(wget -q https://download.qt.io/official_releases/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz \
|| wget -q https://qt.mirror.constant.com/archive/qt/5.15/5.15.6/single/qt-everywhere-opensource-src-5.15.6.tar.xz) && \
echo "💬 \033[1;36mExtracting archive ...\033[0m" && \
tar xf qt-everywhere-opensource-src-5.15.6.tar.xz && \
rm qt-everywhere-opensource-src-5.15.6.tar.xz && \
cd qt-everywhere-src-5.15.6 && \
echo "💬 \033[1;36mPatching Qt ...\033[0m" && \
cd qtbase && (wget https://download.qt.io/official_releases/qt/5.15/CVE-2022-37434-qtbase-5.15.patch \
|| wget https://qt.mirror.constant.com/archive/qt/5.15//CVE-2022-37434-qtbase-5.15.patch) && \
patch -p1 < CVE-2022-37434-qtbase-5.15.patch && rm -vf CVE-2022-37434-qtbase-5.15.patch && cd .. \
echo "💬 \033[1;36mConfiguring Qt ...\033[0m" && \
./configure -opensource -confirm-license -release -static -nomake tests -nomake examples -no-compile-examples \
-prefix /opt/local/qt -no-gui -no-sse2 -openssl-linked -no-shared -c++std c++17 -no-widgets -no-dbus -no-cups -no-freetype -no-fontconfig -no-gif \
-no-ico -no-libpng -no-libjpeg -strip -no-opengl -no-sqlite -no-glib -no-iconv -optimize-size -no-harfbuzz -no-sql-sqlite -no-sql-mysql \
-qpa 'linuxfb' -no-feature-accessibility -nomake tools -no-linuxfb -no-xcb -no-feature-sqlmodel -no-feature-itemmodeltester \
-no-feature-sessionmanager -no-feature-vnc -no-icu -skip qtconnectivity \
-qt-pcre -qt-zlib -no-tiff -no-webp -no-gstreamer -no-libinput \
-skip qtwebengine -skip qt3d -skip qtlocation -skip qtquick3d \
OPENSSL_PREFIX="/opt/local/openssl" OPENSSL_LIBS="-lssl -lcrypto -lpthread" && \
echo "" && echo "💬 \033[1;36mCompiling Qt ...\033[0m" && \
make -j $(nproc) && \
echo "" && echo "💬 \033[1;36mInstalling Qt ...\033[0m" && \
make install && \
cd /opt && \
echo "" && echo "💬 \033[1;36mCleaning up ...\033[0m" && \
rm -rf qt-everywhere-src-5.15.6 && \
echo "" && echo "👍 \033[1;32mGCC Version:\033[0m" && \
gcc --version && \
echo "👍 \033[1;32mQt Version:\033[0m" && \
/opt/local/qt/bin/qmake --version
ENV PATH="${PATH}:/opt/local/qt/bin"