Skip to content

Commit a347e7d

Browse files
authored
Merge pull request #74 from LibrePCB/ubuntu-22.04-qt6.10
Add Ubuntu 22.04 image with Qt 6.10
2 parents 0e22514 + d3fa422 commit a347e7d

File tree

3 files changed

+204
-0
lines changed

3 files changed

+204
-0
lines changed

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.10`
30+
31+
Based on Ubuntu 22.04, containing Qt 6.10.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.10/Dockerfile

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