Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
182 changes: 18 additions & 164 deletions client-qt6/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
FROM ubuntu:22.04
FROM debian:trixie

MAINTAINER Desktop Team <[email protected]>

Check warning on line 3 in client-qt6/Dockerfile

View workflow job for this annotation

GitHub Actions / Push Docker image client-qt6:client-trixie-6.8.2-1 to GitHub Packages

The MAINTAINER instruction is deprecated, use a label instead to define an image author

MaintainerDeprecated: Maintainer instruction is deprecated in favor of using label More info: https://docs.docker.com/go/dockerfile/rule/maintainer-deprecated/

# Run 'docker build' with '--build-arg BUILD_QT=1' to build Qt from source (default: not set)
ARG BUILD_QT

ENV VER_QT 6.8.1
ENV VER_QT_DATE 2025-01-16
ENV VER_OPENSSL 3.4.0
ENV VER_LIBP11 libp11-0.4.12
ENV VER_KFRAMEWORKS 6.10.0
ENV VER_SQLITE 3460100
ENV VER_SQLITE_YEAR 2024
ENV VER_QTKEYCHAIN 0.15.0

ENV QT_ROOT /opt/qt

RUN sed -i '/deb-src/s/^# //' /etc/apt/sources.list && \
RUN \
apt-get update && \
apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget && \
apt-get install -y apt-transport-https ca-certificates gnupg wget && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -q -y \
git \
Expand All @@ -28,17 +14,16 @@
perl \
python3 \
python3-pip \
software-properties-common \
build-essential \
mesa-common-dev \
pkg-config \
ninja-build \
gcc-11 \
g++-11 \
clang-15 \
clang-format-15 \
clang-tidy-15 \
libclang-15-dev \
gcc \
g++ \
clang \
clang-format \
clang-tidy \
libclang-dev \
cmake \
zlib1g-dev \
xz-utils \
Expand Down Expand Up @@ -70,22 +55,24 @@
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
python3-sphinxcontrib.serializinghtml \
python3-sphinxcontrib.qthelp \
python3-sphinx \
unzip \
libsecret-1-dev \
libssl-dev \
libp11-dev \
qt6-websockets-dev \
qt6-svg-dev \
libkf6archive-dev \
qtkeychain-qt6-dev \
libsqlite3-dev \
qt6-5compat-dev \
# For cmocka based csync tests
libcmocka-dev \
# generate png images from svg
inkscape \
# SonarCloud
openjdk-19-jdk \
openjdk-21-jdk \
# install xvfb to enable graphical tests
xvfb \
# html documentation generation
python3-sphinx && \
apt-get build-dep -q -y \
qt6-base-dev \
qt6-base-dev-tools \
qt6-l10n-tools \
Expand All @@ -101,147 +88,14 @@
qt6-quick3d-dev \
qt6-translations-l10n \
libqt6sql6-sqlite && \
apt-get remove -y -q --purge libqt6core6 nodejs && \
# Cleaning up
DEBIAN_FRONTEND=noninteractive apt-get remove -q -y --purge libssl-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

###########################################################################

# Install openssl
RUN cd /tmp && \
wget https://www.openssl.org/source/openssl-${VER_OPENSSL}.tar.gz && \
tar -xvf openssl-${VER_OPENSSL}.tar.gz && \
cd openssl-${VER_OPENSSL} && \
./config && \
make -j$(nproc) && \
make -j$(nproc) install && \
cd .. && \
rm -rf openssl*

# Install libp11 for PKCS#11 encryption
RUN cd /tmp && \
wget https://github.com/OpenSC/libp11/releases/download/${VER_LIBP11}/${VER_LIBP11}.tar.gz && \
tar xvf ${VER_LIBP11}.tar.gz && \
cd ${VER_LIBP11} && \
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig && \
./configure && make && make install && \
cd .. && \
rm -rf ${VER_LIBP11}

# Install sqlite3 from https://www.sqlite.org/amalgamation.html
# https://www3.sqlite.org/src/dir?ci=tip&name=autoconf
RUN cd /tmp && \
wget https://www.sqlite.org/${VER_SQLITE_YEAR}/sqlite-autoconf-${VER_SQLITE}.tar.gz && \
tar xvf sqlite-autoconf-${VER_SQLITE}.tar.gz && \
cd sqlite-autoconf-${VER_SQLITE} && \
./configure && make && make install && \
cd .. && \
rm -rf sqlite-autoconf-${VER_SQLITE}

###########################################################################

# Download Qt sources
RUN if [ "$BUILD_QT" = "1" ] ; then echo Build Qt from source. && \
git clone --depth=1 --recurse-submodules --shallow-submodules --branch=v${VER_QT} https://code.qt.io/qt/qt5.git qt6 \
; fi

RUN if [ "$BUILD_QT" = "1" ] ; then \
wget https://nodejs.org/dist/v18.20.1/node-v18.20.1-linux-x64.tar.xz && \
tar xf node-v18.20.1-linux-x64.tar.xz \
; fi

# Build Qt
RUN if [ "$BUILD_QT" = "1" ] ; then \
mkdir qt6-${VER_QT}-linux-release && \
cd qt6-${VER_QT}-linux-release && \
export PATH=${PATH}:/node-v18.20.1-linux-x64/bin && \
/qt6/configure -release -nomake examples -nomake tests -opensource -confirm-license -openssl-linked -skip qt3d -- \
-DCMAKE_INSTALL_PREFIX=${QT_ROOT} -DOPENSSL_ROOT_DIR=/usr/local/lib64 -DQT_BUILD_TESTS=OFF -DQT_BUILD_EXAMPLES=ON -DQT_FEATURE_thread=ON -DQT_FEATURE_xcb=ON -DQT_FEATURE_openssl_runtime=OFF -DQT_FEATURE_openssl_linked=ON && \
cmake --build . --parallel && \
cmake --install . \
; fi

# Build Qt
RUN if [ "$BUILD_QT" = "1" ] ; then \
tar cfJ /qt-bin-${VER_QT}-openssl-${VER_OPENSSL}-linux-x86_64-$(date +"%Y-%m-%d").tar.xz ${QT_ROOT} \
; fi

#
# The following precompiled Qt package has been built with the commands above, using this Dockerfile.
#
# Since it takes a very long time to compile, the build on Docker Hub fails due to a timeout.
#
# This is why we're going to use our own precompiled version here.
#
# Run 'docker build' with '--build-arg BUILD_QT=1' to build Qt from source (default: not set)
# on a dedicated build machine:
#
# docker build . -t client-5.15 . --build-arg BUILD_QT=1
#

# Download Qt precompiled
ENV QT_TARBALL qt-bin-${VER_QT}-openssl-${VER_OPENSSL}-linux-x86_64-${VER_QT_DATE}.tar.xz

RUN if [ "$BUILD_QT" != "1" ] ; then \
wget https://download.nextcloud.com/desktop/development/qt/${QT_TARBALL} && \
tar -xvf ${QT_TARBALL} && \
rm ${QT_TARBALL} \
; fi

RUN if [ "$BUILD_QT" != "1" ] ; then \
DEBIAN_FRONTEND=noninteractive apt-get remove -q -y --purge libsqlite3-dev \
; fi

###########################################################################

# Install QtKeychain
RUN if [ "$BUILD_QT" != "1" ] ; then \
cd /tmp && \
git clone https://github.com/frankosterfeld/qtkeychain.git --depth 1 -b ${VER_QTKEYCHAIN} && \
cd qtkeychain && \
mkdir build && \
cd build && \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_QT6=ON -DCMAKE_PREFIX_PATH=${QT_ROOT} .. && \
cmake --build . --parallel && \
cmake --install . && \
cd .. && \
rm -rf qtkeychain \
; fi

# Install extra-cmake-modules
RUN \
cd /tmp && \
git clone https://invent.kde.org/frameworks/extra-cmake-modules.git --depth 1 -b v${VER_KFRAMEWORKS} && \
cd extra-cmake-modules && \
mkdir build && \
cd build && \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DCMAKE_PREFIX_PATH=${QT_ROOT} .. && \
cmake --build . --parallel && \
cmake --install . && \
cd .. && \
rm -rf extra-cmake-modules \
;

# Install KArchive
RUN \
cd /tmp && \
git clone https://invent.kde.org/frameworks/karchive.git --depth 1 -b v${VER_KFRAMEWORKS} && \
cd karchive && \
mkdir build && \
cd build && \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DQT_MAJOR_VERSION=6 -DCMAKE_PREFIX_PATH=${QT_ROOT} .. && \
cmake --build . --parallel && \
cmake --install . && \
cd .. && \
rm -rf karchive \
;

# Setup sonar-scanner
ENV SONAR_SCANNER_VERSION 5.0.1.3006

Check warning on line 96 in client-qt6/Dockerfile

View workflow job for this annotation

GitHub Actions / Push Docker image client-qt6:client-trixie-6.8.2-1 to GitHub Packages

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV SONAR_SERVER_URL "https://sonarcloud.io"

Check warning on line 97 in client-qt6/Dockerfile

View workflow job for this annotation

GitHub Actions / Push Docker image client-qt6:client-trixie-6.8.2-1 to GitHub Packages

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV SONAR_SCANNER_DOWNLOAD_URL https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip

Check warning on line 98 in client-qt6/Dockerfile

View workflow job for this annotation

GitHub Actions / Push Docker image client-qt6:client-trixie-6.8.2-1 to GitHub Packages

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

RUN mkdir -p /opt/sonar && \
curl -sSLo /opt/sonar/sonar-scanner.zip ${SONAR_SCANNER_DOWNLOAD_URL} && \
Expand All @@ -250,7 +104,7 @@
ENV PATH=/opt/sonar/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:${PATH}

# Setup build-wrapper
ENV BUILD_WRAPPER_DOWNLOAD_URL ${SONAR_SERVER_URL}/static/cpp/build-wrapper-linux-x86.zip

Check warning on line 107 in client-qt6/Dockerfile

View workflow job for this annotation

GitHub Actions / Push Docker image client-qt6:client-trixie-6.8.2-1 to GitHub Packages

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

RUN curl -sSLo /opt/sonar/build-wrapper-linux-x86.zip ${BUILD_WRAPPER_DOWNLOAD_URL} && \
unzip -o /opt/sonar/build-wrapper-linux-x86.zip -d /opt/sonar/
Expand Down
Loading