From 215ceb0393e890367a40c6bec7236bd9162cf088 Mon Sep 17 00:00:00 2001 From: Richard Weickelt Date: Tue, 17 Mar 2020 13:35:36 +0100 Subject: Remove Debian stretch from Docker build environments We have not been able to build Qbs with it for a while and it was superseded by Ubuntu Bionic. Change-Id: I8fe0d40baf8f522d4fd0b94a0b403b324c300e74 Reviewed-by: Ivan Komissarov Reviewed-by: Christian Kandeler --- docker/stretch/Dockerfile | 73 -------------------------------------------- docker/stretch/entrypoint.sh | 69 ----------------------------------------- 2 files changed, 142 deletions(-) delete mode 100644 docker/stretch/Dockerfile delete mode 100755 docker/stretch/entrypoint.sh (limited to 'docker') diff --git a/docker/stretch/Dockerfile b/docker/stretch/Dockerfile deleted file mode 100644 index 736bd1ef7..000000000 --- a/docker/stretch/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# -# Downloads and builds Qt from source. This is simpler than using the Qt online -# installer. We do it in a separate stage to keep the number of dependencies low -# in the final Docker image. -# -FROM debian:9 -LABEL Description="Debian development environment for Qbs with Qt and various dependencies for testing Qbs modules and functionality" -ARG QT_VERSION -ARG QTCREATOR_VERSION - -# Allow colored output on command line. -ENV TERM=xterm-color - -# -# Make it possible to change UID/GID in the entrypoint script. The docker -# container usually runs as root user on Linux hosts. When the Docker container -# mounts a folder on the host and creates files there, those files would be -# owned by root instead of the current user. Thus we create a user here who's -# UID will be changed in the entrypoint script to match the UID of the current -# host user. -# -ARG USER_UID=1000 -ARG USER_NAME=devel -RUN apt-get update -qq && \ - apt-get install -qq -y --no-install-recommends \ - ca-certificates \ - gosu \ - sudo && \ - groupadd -g ${USER_UID} ${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 docker/stretch/entrypoint.sh entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] - - -# Build and run dependencies for Qbs -RUN apt-get install -qq -y --no-install-recommends \ - build-essential \ - curl \ - git \ - help2man \ - libclang-3.9 \ - libdbus-1-3 \ - libgl1-mesa-glx \ - libfreetype6 \ - libfontconfig1 \ - libgl1-mesa-dev \ - make \ - pkg-config \ - python-pip \ - p7zip-full && \ - pip install beautifulsoup4 lxml # for building the documentation - -ENV LLVM_INSTALL_DIR=/usr/lib/llvm-3.9 - -COPY scripts/install-qt.sh install-qt.sh - -RUN ./install-qt.sh --version ${QT_VERSION} qtbase qtdeclarative qtscript qttools qtx11extras icu && \ - ./install-qt.sh --version ${QTCREATOR_VERSION} qtcreator && \ - echo "export PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:/opt/Qt/Tools/QtCreator/bin:\${PATH}" > /etc/profile.d/qt.sh - -ENV PATH=/opt/Qt/${QT_VERSION}/gcc_64/bin:/opt/Qt/Tools/QtCreator/bin:${PATH} - -# Configure Qbs -USER $USER_NAME -RUN qbs-setup-toolchains --detect && \ - qbs-setup-qt /opt/Qt/${QT_VERSION}/gcc_64/bin/qmake qt && \ - qbs config defaultProfile qt - -# Switch back to root user for the entrypoint script. -USER root diff --git a/docker/stretch/entrypoint.sh b/docker/stretch/entrypoint.sh deleted file mode 100755 index 04504ffcc..000000000 --- a/docker/stretch/entrypoint.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash -set -e - -############################################################################# -## -## Copyright (C) 2019 Richard Weickelt -## Contact: https://www.qt.io/licensing/ -## -## This file is part of Qbs. -## -## $QT_BEGIN_LICENSE:LGPL$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 3 as published by the Free Software -## Foundation and appearing in the file LICENSE.LGPL3 included in the -## packaging of this file. Please review the following information to -## ensure the GNU Lesser General Public License version 3 requirements -## will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 2.0 or (at your option) the GNU General -## Public license version 3 or any later version approved by the KDE Free -## Qt Foundation. The licenses are as published by the Free Software -## Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-2.0.html and -## https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# - -# -# Try to determine the uid of the working directory and adjust the current -# user's uid/gid accordingly. -# -WORKDIR_GID=$(stat -c "%g" .) -WORKDIR_UID=$(stat -c "%u" .) -USER_NAME=${USER_NAME:-devel} -EXEC="" - -if [ "$(id -u ${USER_NAME})" != "0" ] && [ "${WORKDIR_UID}" != "0" ] ; then - - export HOME=/home/${USER_NAME} - - if [ "$(id -u ${USER_NAME})" != "${WORKDIR_UID}" ]; then - usermod -u ${WORKDIR_UID} ${USER_NAME} - groupmod -g ${WORKDIR_GID} ${USER_NAME} - chown -R -h ${WORKDIR_UID} /home; - chgrp -R -h ${WORKDIR_GID} /home; - fi - EXEC="exec gosu ${USER_NAME}:${USER_NAME}" -fi - -if [ -z "$1" ]; then - ${EXEC} bash --login -else - ${EXEC} bash --login -c "$*" -fi -- cgit v1.2.3 From 92b39d31334b7503c5ab37713b2077b5e0fb64c3 Mon Sep 17 00:00:00 2001 From: Richard Weickelt Date: Tue, 17 Mar 2020 13:24:27 +0100 Subject: Use docker-compose exclusively for managing Docker images Qbs used to have docker products and a module for building the images, but this became obsolet and was superseded by the docker-compose infrastructure. Docker-compose is a much better fit for our use-case (which is mostly CI). It allows us to use unique (and complicated) tags both when building and running the images without exposing that to the user. Unique tags like bionic-5.12.6_1.14.1-2 instead of just bionic ensure that changes in the infrastructure don't suddenly break builds in older branches using the same image. This patch also updates the documentation to emphasize the usage of docker-compose. Change-Id: I45335d37034d10dda5ab5079ee3be1f81cb3e5c5 Reviewed-by: Ivan Komissarov Reviewed-by: Christian Kandeler --- docker/docker.qbs | 38 ++++++-------------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) (limited to 'docker') diff --git a/docker/docker.qbs b/docker/docker.qbs index 752c61d3b..513a5fd8b 100644 --- a/docker/docker.qbs +++ b/docker/docker.qbs @@ -1,34 +1,8 @@ -import qbs -Project { - Product { - Depends { name: "docker"; required: false } - - name: "qbs-docker-stretch" - type: ["docker.docker-image"] - builtByDefault: false - condition: docker.present - - docker.imageTag: "qbsbuild/qbsdev:stretch" - - files: [ - "stretch/Dockerfile", - "stretch/entrypoint.sh", - ] - } - - Product { - Depends { name: "docker"; required: false } - - name: "qbs-docker-windowsservercore" - type: ["docker.docker-image"] - builtByDefault: false - condition: docker.present - - docker.imageTag: "qbsbuild/qbsdev:windowsservercore" - - files: [ - "windowsservercore/Dockerfile", - ] - } +// This is a convenience product to be able to use Qt Creator for editing the docker files. +// For building and managing the images, use docker-compose as explained in +// https://doc.qt.io/qbs/building-qbs.html#using-docker. +Product { + name: "docker" + files: "**" } -- cgit v1.2.3