Skip to content

Commit b768a7c

Browse files
committed
Add Ubuntu 22.04 image with Qt 6.11
1 parent 7779e3e commit b768a7c

3 files changed

Lines changed: 215 additions & 0 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ In addition, this image contains
2626
[`linuxdeployqt`](https://github.com/probonopd/linuxdeployqt) to build the
2727
AppImage.
2828

29+
### `ubuntu-22.04-qt6.11`
30+
31+
Based on Ubuntu 22.04, containing Qt 6.11.x from
32+
[download.qt.io](https://download.qt.io) and OpenCascade OCCT from
33+
[github/Open-Cascade-SAS/OCCT](https://github.com/Open-Cascade-SAS/OCCT).
34+
This image is intended for deployment of official binary releases of LibrePCB,
35+
which should be linked against an old version of `glibc` (for maximum
36+
compatibility) but still using a recent Qt version (to get the latest
37+
features/bugfixes of Qt).
38+
39+
In addition, this image contains
40+
[`linuxdeployqt`](https://github.com/probonopd/linuxdeployqt) to build the
41+
AppImage.
42+
2943
### `ubuntu-22.04`
3044

3145
Based on Ubuntu 22.04, containing Qt from the official Ubuntu package

ubuntu-22.04-qt6.11/Dockerfile

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
FROM ubuntu:22.04
2+
3+
# Install APT packages
4+
ARG DEBIAN_FRONTEND=noninteractive
5+
RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
6+
bzip2 \
7+
ca-certificates \
8+
ccache \
9+
clang \
10+
cmake \
11+
curl \
12+
dbus \
13+
doxygen \
14+
file \
15+
g++ \
16+
git \
17+
graphviz \
18+
libc++-dev \
19+
libc++abi-dev \
20+
libcups2 \
21+
libegl1-mesa \
22+
libfbclient2 \
23+
libffi-dev \
24+
libfontconfig1 \
25+
libfreetype6 \
26+
libglu1-mesa-dev \
27+
libpq5 \
28+
libssl-dev \
29+
libxcb-cursor0 \
30+
libxcb-glx0 \
31+
libxcb-icccm4 \
32+
libxcb-icccm4 \
33+
libxcb-image0 \
34+
libxcb-keysyms1 \
35+
libxcb-randr0 \
36+
libxcb-render-util0 \
37+
libxcb-shape0 \
38+
libxcb-shm0 \
39+
libxcb-xfixes0 \
40+
libxcb-xinerama0 \
41+
libxcb1 \
42+
libxkbcommon-x11-0 \
43+
make \
44+
ninja-build \
45+
p7zip-full \
46+
# patchelf is only needed for the ugly workaround to get lrelease working
47+
patchelf \
48+
software-properties-common \
49+
wget \
50+
xvfb \
51+
zlib1g \
52+
zlib1g-dev \
53+
&& rm -rf /var/lib/apt/lists/*
54+
55+
# Install Rust
56+
# Make .cargo/ writable for everyone to allow running the container as non-root.
57+
ARG RUST_VERSION="1.95.0"
58+
ENV RUSTUP_HOME="/.rustup" \
59+
CARGO_HOME="/.cargo" \
60+
PATH="/.cargo/bin:$PATH"
61+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
62+
| sh -s -- -y --default-toolchain $RUST_VERSION --profile minimal --no-modify-path \
63+
&& cargo install cargo-llvm-cov \
64+
&& rm -rf $CARGO_HOME/registry $CARGO_HOME/git \
65+
&& chmod 777 $RUSTUP_HOME \
66+
&& chmod 777 $CARGO_HOME
67+
68+
# Install OpenCascade
69+
ARG OCC_VERSION="7_9_1"
70+
ARG OCC_URL="https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V$OCC_VERSION.tar.gz"
71+
RUN wget -c "${OCC_URL}" -O /tmp.tar.gz \
72+
&& tar -xzf /tmp.tar.gz -C /opt \
73+
&& rm /tmp.tar.gz \
74+
&& cd "/opt/OCCT-$OCC_VERSION" \
75+
&& cmake . -G "Ninja" \
76+
-DCMAKE_BUILD_TYPE=Release \
77+
-DINSTALL_DIR=/usr \
78+
-DBUILD_LIBRARY_TYPE=Shared \
79+
-DBUILD_DOC_Overview=0 \
80+
-DBUILD_MODULE_ApplicationFramework=0 \
81+
-DBUILD_MODULE_DataExchange=1 \
82+
-DBUILD_MODULE_Draw=0 \
83+
-DBUILD_MODULE_FoundationClasses=0 \
84+
-DBUILD_MODULE_ModelingAlgorithms=0 \
85+
-DBUILD_MODULE_ModelingData=0 \
86+
-DBUILD_MODULE_Visualization=0 \
87+
-DUSE_DRACO=0 \
88+
-DUSE_FREEIMAGE=0 \
89+
-DUSE_FREETYPE=0 \
90+
-DUSE_GLES2=0 \
91+
-DUSE_OPENGL=0 \
92+
-DUSE_OPENVR=0 \
93+
-DUSE_RAPIDJSON=0 \
94+
-DUSE_TBB=0 \
95+
-DUSE_TK=0 \
96+
-DUSE_VTK=0 \
97+
&& ninja && ninja install \
98+
&& cd / && rm -rf "/opt/OCCT-$OCC_VERSION"
99+
100+
# Install Qt Tools
101+
ARG QT_VERSION="6.11.1"
102+
ARG QT_BASEURL="https://download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt6_6111/qt6_6111"
103+
ARG QT_URL="$QT_BASEURL/qt.qt6.6111.linux_gcc_64/6.11.1-0-202605060425"
104+
ENV QTDIR="/opt/qt" \
105+
PATH="/opt/qt/bin:$PATH" \
106+
LD_LIBRARY_PATH="/opt/qt/lib:$LD_LIBRARY_PATH" \
107+
PKG_CONFIG_PATH="/opt/qt/lib/pkgconfig:$PKG_CONFIG_PATH"
108+
RUN mkdir /opt/qt \
109+
&& wget -c "${QT_URL}qttools-Linux-RHEL_9_6-GCC-Linux-RHEL_9_6-X86_64.7z" -O /tmp.7z \
110+
&& 7za x /tmp.7z -o/opt/qt \
111+
&& rm /tmp.7z \
112+
# Ugly workaround for lrelease failing to run due to missing libQt6Qml.so.6,
113+
# which doesn't make sense as this CLI tool should not depend on QML at all:
114+
&& patchelf --remove-needed libQt6Qml.so.6 /opt/qt/bin/lrelease \
115+
# The AppImage deployment tools might read some paths from the Qt libraries,
116+
# but they are wrong so let's create a symlink to make them working anyway:
117+
&& mkdir -p "/home/qt/work" \
118+
&& ln -s "/opt/qt" "/home/qt/work/install"
119+
120+
# Install Qt Base
121+
RUN wget -c "${QT_URL}qtbase-Linux-RHEL_9_6-GCC-Linux-RHEL_9_6-X86_64.7z" -O /tmp.7z \
122+
&& 7za x /tmp.7z -o/opt/qt \
123+
# Allow removing unneeded SQL plugins during CI job to fix deployment issue:
124+
# https://forum.qt.io/topic/151452/what-qt-specific-files-exactly-do-i-need-to-add-when-deploying
125+
&& chmod 777 $QTDIR/plugins/sqldrivers \
126+
&& rm /tmp.7z
127+
128+
# Install Qt SVG
129+
RUN wget -c "${QT_URL}qtsvg-Linux-RHEL_9_6-GCC-Linux-RHEL_9_6-X86_64.7z" -O /tmp.7z \
130+
&& 7za x /tmp.7z -o/opt/qt \
131+
&& rm /tmp.7z
132+
133+
# Install Qt Translations
134+
RUN wget -c "${QT_URL}qttranslations-Linux-RHEL_9_6-GCC-Linux-RHEL_9_6-X86_64.7z" -O /tmp.7z \
135+
&& 7za x /tmp.7z -o/opt/qt \
136+
&& rm /tmp.7z
137+
138+
# Install Qt Image Formats Plugin
139+
RUN wget -c "${QT_BASEURL}/qt.qt6.6111.addons.qtimageformats.linux_gcc_64/6.11.1-0-202605060425qtimageformats-Linux-RHEL_9_6-GCC-Linux-RHEL_9_6-X86_64.7z" -O /tmp.7z \
140+
&& 7za x /tmp.7z -o/opt/qt \
141+
&& rm /tmp.7z
142+
143+
# Install libicu
144+
RUN wget -c "${QT_URL}icu-linux-Rhel8.6-x86_64.7z" -O /tmp.7z \
145+
&& 7za x /tmp.7z -o/opt/qt/lib \
146+
&& rm /tmp.7z
147+
148+
# Install linuxdeploy
149+
ARG LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage"
150+
ARG LINUXDEPLOY_PLUGIN_APPIMAGE_URL="https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-appimage-x86_64.AppImage"
151+
ARG LINUXDEPLOY_PLUGIN_QT_URL="https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-qt-x86_64.AppImage"
152+
ENV APPIMAGE_EXTRACT_AND_RUN=1
153+
RUN wget -c "$LINUXDEPLOY_URL" -O /usr/local/bin/linuxdeploy-x86_64.AppImage \
154+
&& chmod a+x /usr/local/bin/linuxdeploy-x86_64.AppImage \
155+
&& wget -c "$LINUXDEPLOY_PLUGIN_APPIMAGE_URL" -O /usr/local/bin/linuxdeploy-plugin-appimage-x86_64.AppImage \
156+
&& chmod a+x /usr/local/bin/linuxdeploy-plugin-appimage-x86_64.AppImage \
157+
&& wget -c "$LINUXDEPLOY_PLUGIN_QT_URL" -O /usr/local/bin/linuxdeploy-plugin-qt-x86_64.AppImage \
158+
&& chmod a+x /usr/local/bin/linuxdeploy-plugin-qt-x86_64.AppImage \
159+
&& linuxdeploy-x86_64.AppImage --list-plugins
160+
161+
# Install UV
162+
# Set its python directory to a known, user-writable path to allow accessing the
163+
# python versions installed during docker build from within CI runs which are
164+
# run as non-root.
165+
ARG UV_VERSION="0.11.11"
166+
ARG UV_URL="https://github.com/astral-sh/uv/releases/download/$UV_VERSION/uv-x86_64-unknown-linux-gnu.tar.gz"
167+
ENV UV_PYTHON_INSTALL_DIR="/.uv/python"
168+
RUN wget -c "${UV_URL}" -O /tmp.tar.gz \
169+
&& tar -xzf /tmp.tar.gz --strip-components=1 -C /usr/local/bin/ \
170+
&& rm /tmp.tar.gz \
171+
&& mkdir -p $UV_PYTHON_INSTALL_DIR && chmod 777 $UV_PYTHON_INSTALL_DIR
172+
173+
# Pre-install a Python version
174+
ARG PYTHON_VERSION="3.14"
175+
RUN uv python install $PYTHON_VERSION
176+
177+
# Install latest OpenSSL to avoid possible issues if servers some day stop
178+
# working with an old OpenSSL library (as already happened in the past).
179+
ARG OPENSSL_VERSION="3.6.2"
180+
ENV LD_LIBRARY_PATH="/opt/openssl/lib:$LD_LIBRARY_PATH"
181+
RUN apt-get remove -y libssl-dev \
182+
&& wget -c "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -O /tmp.tar.gz \
183+
&& tar -zxf /tmp.tar.gz \
184+
&& cd "./openssl-$OPENSSL_VERSION" \
185+
&& ./config --prefix=/opt/openssl --libdir=lib --openssldir=/opt/openssl/etc/ssl \
186+
&& make -j8 \
187+
&& make install_sw \
188+
&& cd .. \
189+
&& rm -rf "./openssl-$OPENSSL_VERSION" \
190+
&& rm /tmp.tar.gz
191+
192+
# Make ccache directory writable for everyone to allow running the container
193+
# as non-root.
194+
ENV CCACHE_DIR="/.ccache"
195+
RUN mkdir $CCACHE_DIR && chmod -R 777 $CCACHE_DIR
196+
197+
# LibrePCB's unittests expect that there is a USERNAME environment variable
198+
ENV USERNAME="root"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:a40a596ffb7892c33cef161fcdb545cf7de6a7760ef4cfc577563ab9453dff88
3+
size 8958296

0 commit comments

Comments
 (0)