aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weickelt <richard@weickelt.de>2019-05-04 12:53:35 +0200
committerRichard Weickelt <richard@weickelt.de>2019-05-07 09:13:30 +0000
commite240504abe490dd9a2d1e905d2b9986bffe8e3ce (patch)
tree617fe32493e7965fb369752e4c2c9b1097cd8cc4
parent8abd205199665e4f78032f064246329c0975f2fd (diff)
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 <joerg.bornemann@qt.io>
-rw-r--r--docker-compose.yml2
-rw-r--r--docker/stretch/Dockerfile29
-rwxr-xr-xdocker/stretch/entrypoint.sh2
3 files changed, 22 insertions, 11 deletions
diff --git a/docker-compose.yml b/docker-compose.yml
index 916004e32..ef38ec26d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,7 +2,7 @@ version: "3.3"
services:
stretch:
- image: qbsdev:stretch
+ image: ${DOCKER_USER:-qbsbuild}/qbsdev:stretch
build:
dockerfile: Dockerfile
context: docker/stretch/
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
#############################################################################
##