From e240504abe490dd9a2d1e905d2b9986bffe8e3ce Mon Sep 17 00:00:00 2001 From: Richard Weickelt Date: Sat, 4 May 2019 12:53:35 +0200 Subject: Update and optimize the Docker infrastructure - Extend Qt installation to enable Qbs autotests and building docs (QtDeclarative and QtTools, libclang were missing). - Add Qt to PATH in the container - Allow users of docker-compose to override the Docker username so that they can potentially use their own repositories without changing the file. - Fix error in the entrypoint script which didn't work when running the container without arguments. - Replace the non-interesting output of building Qt with dots because the log exceeded the maximum log length on Travis CI, but being entirely silent triggered the watchdog. Task-number: QBS-1438 Change-Id: Ibd3abacadfc001db5169a9a3fffce908f8e6e760 Reviewed-by: Joerg Bornemann --- docker/stretch/Dockerfile | 29 ++++++++++++++++++++--------- docker/stretch/entrypoint.sh | 2 +- 2 files changed, 21 insertions(+), 10 deletions(-) (limited to 'docker') diff --git a/docker/stretch/Dockerfile b/docker/stretch/Dockerfile index 9c19d26f9..70db3dd8d 100644 --- a/docker/stretch/Dockerfile +++ b/docker/stretch/Dockerfile @@ -31,6 +31,7 @@ RUN apt-get update -qq && \ build-essential \ flex \ intltool \ + libclang-3.9-dev \ libgdk-pixbuf2.0-dev \ libffi-dev \ libfontconfig1-dev \ @@ -49,8 +50,11 @@ RUN apt-get update -qq && \ libx11-xcb-dev \ libxcb-glx0-dev \ libz-dev \ + python \ openssl +ENV LLVM_INSTALL_DIR=/usr/lib/llvm-3.9 + # Build Qt RUN mkdir -p qt/build && \ cd qt/build && \ @@ -60,18 +64,17 @@ RUN mkdir -p qt/build && \ -shared \ -opensource \ -confirm-license \ - -no-compile-examples \ + -nomake examples \ -nomake tests \ -platform linux-g++ \ - -qt-freetype -qt-harfbuzz -qt-pcre -qt-xcb -qt-zlib \ - -no-sql-sqlite -no-cups -no-dbus -no-pch \ + -qt-freetype -qt-harfbuzz -qt-pcre -qt-sqlite -qt-xcb -qt-zlib \ + -no-cups -no-dbus -no-pch \ -no-feature-accessibility -no-opengl \ -skip qtactiveqt \ -skip qt3d \ -skip qtcanvas3d \ -skip qtcharts \ -skip qtconnectivity \ - -skip qtdeclarative \ -skip qtdatavis3d \ -skip qtdoc \ -skip qtgamepad \ @@ -79,6 +82,7 @@ RUN mkdir -p qt/build && \ -skip qtimageformats \ -skip qtlocation \ -skip qtmultimedia \ + -skip qtnetworkauth \ -skip qtquickcontrols \ -skip qtquickcontrols2 \ -skip qtpurchasing \ @@ -89,7 +93,6 @@ RUN mkdir -p qt/build && \ -skip qtspeech \ -skip qtsvg \ -skip qttranslations \ - -skip qttools \ -skip qtwayland \ -skip qtvirtualkeyboard \ -skip qtwebchannel \ @@ -98,8 +101,10 @@ RUN mkdir -p qt/build && \ -skip qtwebview \ -skip qtwinextras \ -skip qtxmlpatterns \ - && \ - make -j $(nproc --all) >/dev/null && \ + -skip qtx11extras + +RUN cd qt/build && \ + make -j $(nproc --all) | stdbuf -o0 tr -cd '\n' | stdbuf -o0 tr '\n' '.' && \ make install # Build a stable Qbs release @@ -123,9 +128,13 @@ ARG USER_UID=1000 ARG USER_NAME=devel RUN apt-get update -qq && \ apt-get install -qq -y \ - gosu && \ + gosu \ + sudo && \ groupadd -g ${USER_UID} ${USER_NAME} && \ - useradd -s /bin/bash -u ${USER_UID} -g ${USER_NAME} -o -c "" -m ${USER_NAME} + useradd -s /bin/bash -u ${USER_UID} -g ${USER_NAME} -o -c "" -m ${USER_NAME} && \ + usermod -a -G sudo ${USER_NAME} && \ + echo "%devel ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers + COPY entrypoint.sh entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] @@ -135,6 +144,7 @@ RUN apt-get update -qq && \ build-essential \ ca-certificates \ git \ + libclang-3.9 \ pkg-config \ make \ help2man \ @@ -145,6 +155,7 @@ RUN apt-get update -qq && \ # Install Qt installation from build stage COPY --from=build-qt-linux-x86_64 /opt/qt5-linux-x86_64 /opt/qt5-linux-x86_64 ENV PATH=/opt/qt5-linux-x86_64/bin:${PATH} +RUN echo "export PATH=/opt/qt5-linux-x86_64/bin:\${PATH}" > /etc/profile.d/qt.sh # Download and build Qbs RUN mkdir -p /qbs && \ diff --git a/docker/stretch/entrypoint.sh b/docker/stretch/entrypoint.sh index f859c2264..04504ffcc 100755 --- a/docker/stretch/entrypoint.sh +++ b/docker/stretch/entrypoint.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -eu +set -e ############################################################################# ## -- cgit v1.2.3