Skip to content

Commit 4b7d5d1

Browse files
authored
Merge pull request #68 from LibrePCB/update-linux-images
Ubuntu: Cleanup & update packages, replace pip by UV
2 parents 72f5a8d + 763170c commit 4b7d5d1

File tree

3 files changed

+53
-94
lines changed

3 files changed

+53
-94
lines changed

ubuntu-20.04-qt6.6/Dockerfile

Lines changed: 20 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
4343
make \
4444
ninja-build \
4545
p7zip-full \
46-
python3 \
47-
python3-pip \
48-
python3-setuptools \
49-
python3-wheel \
5046
software-properties-common \
5147
wget \
5248
xvfb \
@@ -58,16 +54,9 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
5854
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
5955
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
6056

61-
# Set Python3 as default Python version
62-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100
63-
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 100
64-
65-
# Allow installing pip packages system-wide since there's no risk in a container
66-
ENV PIP_BREAK_SYSTEM_PACKAGES=1
67-
6857
# Install Rust
6958
# Make .cargo/ writable for everyone to allow running the container as non-root.
70-
ARG RUST_VERSION="1.85.1"
59+
ARG RUST_VERSION="1.87.0"
7160
ENV RUSTUP_HOME="/.rustup" \
7261
CARGO_HOME="/.cargo" \
7362
PATH="/.cargo/bin:$PATH"
@@ -77,7 +66,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
7766
&& chmod 777 $CARGO_HOME
7867

7968
# Install CMake
80-
ARG CMAKE_VERSION="3.31.1"
69+
ARG CMAKE_VERSION="4.0.3"
8170
ARG CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION.tar.gz"
8271
RUN wget -c "${CMAKE_URL}" -O /tmp.tar.gz \
8372
&& tar -xzf /tmp.tar.gz -C /opt \
@@ -88,17 +77,8 @@ RUN wget -c "${CMAKE_URL}" -O /tmp.tar.gz \
8877
&& make install \
8978
&& cd / && rm -rf "/opt/cmake-$CMAKE_VERSION"
9079

91-
# Install sccache
92-
ARG SCCACHE_VERSION="0.8.2"
93-
ARG SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION/sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz"
94-
RUN wget -c "$SCCACHE_URL" -O /tmp.tar.gz \
95-
&& tar -zxf /tmp.tar.gz \
96-
&& cp "./sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache" /usr/local/bin/ \
97-
&& rm -rf "./sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl" \
98-
&& rm /tmp.tar.gz
99-
10080
# Install OpenCascade
101-
ARG OCC_VERSION="7_7_2"
81+
ARG OCC_VERSION="7_9_1"
10282
ARG OCC_URL="https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V$OCC_VERSION.tar.gz"
10383
RUN wget -c "${OCC_URL}" -O /tmp.tar.gz \
10484
&& tar -xzf /tmp.tar.gz -C /opt \
@@ -162,21 +142,11 @@ RUN wget -c "${QT_URL}qtsvg-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64.7z" -O /tmp
162142
&& 7za x /tmp.7z -o/opt/qt \
163143
&& rm /tmp.7z
164144

165-
# Install Qt Declarative
166-
RUN wget -c "${QT_URL}qtdeclarative-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64.7z" -O /tmp.7z \
167-
&& 7za x /tmp.7z -o/opt/qt \
168-
&& rm /tmp.7z
169-
170145
# Install Qt Translations
171146
RUN wget -c "${QT_URL}qttranslations-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64.7z" -O /tmp.7z \
172147
&& 7za x /tmp.7z -o/opt/qt \
173148
&& rm /tmp.7z
174149

175-
# Install Qt5 Compat
176-
RUN wget -c "${QT_BASEURL}/qt.qt6.662.qt5compat.gcc_64/6.6.2-0-202402121133qt5compat-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64.7z" -O /tmp.7z \
177-
&& 7za x /tmp.7z -o/opt/qt \
178-
&& rm /tmp.7z
179-
180150
# Install Qt Image Formats Plugin
181151
RUN wget -c "${QT_BASEURL}/qt.qt6.662.addons.qtimageformats.gcc_64/6.6.2-0-202402121133qtimageformats-Linux-RHEL_8_8-GCC-Linux-RHEL_8_8-X86_64.7z" -O /tmp.7z \
182152
&& 7za x /tmp.7z -o/opt/qt \
@@ -187,29 +157,6 @@ RUN wget -c "${QT_URL}icu-linux-Rhel7.2-x64.7z" -O /tmp.7z \
187157
&& 7za x /tmp.7z -o/opt/qt \
188158
&& rm /tmp.7z
189159

190-
# Install linuxdeployqt
191-
ARG LINUXDEPLOYQT_URL="https://github.com/probonopd/linuxdeployqt/releases/download/10/linuxdeployqt-continuous-x86_64.AppImage"
192-
RUN wget -c "$LINUXDEPLOYQT_URL" -O /linuxdeployqt.AppImage \
193-
&& chmod a+x /linuxdeployqt.AppImage \
194-
&& /linuxdeployqt.AppImage --appimage-extract \
195-
&& chmod -R 755 /squashfs-root \
196-
&& mv /squashfs-root /opt/linuxdeployqt \
197-
&& ln -s /opt/linuxdeployqt/AppRun /usr/local/bin/linuxdeployqt \
198-
&& rm /linuxdeployqt.AppImage
199-
200-
# Install beta appimagetool which should not depend on any system libraries
201-
# anymore, and should therefore run on Ubuntu 22.04 which doesn't provide
202-
# libfuse2 anymore (see https://github.com/LibrePCB/LibrePCB/issues/980).
203-
# However, since there are no official releases yet, the binary is downloaded
204-
# from the nightly build and added to the repository. Download URL:
205-
# https://github.com/probonopd/go-appimage/releases/download/continuous/appimagetool-765-x86_64.AppImage
206-
COPY appimagetool-x86_64.AppImage /appimagetool-x86_64.AppImage
207-
RUN /appimagetool-x86_64.AppImage --appimage-extract \
208-
&& chmod -R 755 /squashfs-root \
209-
&& mv /squashfs-root /opt/appimagetool \
210-
&& ln -s /opt/appimagetool/AppRun /usr/local/bin/appimagetool \
211-
&& rm /appimagetool-x86_64.AppImage
212-
213160
# Install linuxdeploy
214161
ARG LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage"
215162
ARG LINUXDEPLOY_PLUGIN_APPIMAGE_URL="https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/1-alpha-20250213-1/linuxdeploy-plugin-appimage-x86_64.AppImage"
@@ -223,9 +170,25 @@ RUN wget -c "$LINUXDEPLOY_URL" -O /usr/local/bin/linuxdeploy-x86_64.AppImage \
223170
&& chmod a+x /usr/local/bin/linuxdeploy-plugin-qt-x86_64.AppImage \
224171
&& linuxdeploy-x86_64.AppImage --list-plugins
225172

173+
# Install UV
174+
# Set its python directory to a known, user-writable path to allow accessing the
175+
# python versions installed during docker build from within CI runs which are
176+
# run as non-root.
177+
ARG UV_VERSION="0.7.13"
178+
ARG UV_URL="https://github.com/astral-sh/uv/releases/download/$UV_VERSION/uv-x86_64-unknown-linux-gnu.tar.gz"
179+
ENV UV_PYTHON_INSTALL_DIR="/.uv/python"
180+
RUN wget -c "${UV_URL}" -O /tmp.tar.gz \
181+
&& tar -xzf /tmp.tar.gz --strip-components=1 -C /usr/local/bin/ \
182+
&& rm /tmp.tar.gz \
183+
&& mkdir -p $UV_PYTHON_INSTALL_DIR && chmod 777 $UV_PYTHON_INSTALL_DIR
184+
185+
# Pre-install a Python version
186+
ARG PYTHON_VERSION="3.13"
187+
RUN uv python install $PYTHON_VERSION
188+
226189
# Install latest OpenSSL to avoid possible issues if servers some day stop
227190
# working with an old OpenSSL library (as already happened in the past).
228-
ARG OPENSSL_VERSION="3.4.1"
191+
ARG OPENSSL_VERSION="3.5.0"
229192
ENV LD_LIBRARY_PATH="/opt/openssl/lib:$LD_LIBRARY_PATH"
230193
RUN apt-get remove -y libssl-dev \
231194
&& wget -c "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -O /tmp.tar.gz \

ubuntu-22.04/Dockerfile

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
2727
libocct-*-dev \
2828
libpolyclipping-dev \
2929
libpolyclipping22 \
30-
libqt6core5compat6-dev \
3130
libqt6opengl6-dev \
3231
libqt6openglwidgets6 \
3332
libqt6sql6-sqlite \
@@ -39,12 +38,7 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
3938
occt-misc \
4039
openssl \
4140
pkg-config \
42-
python3 \
43-
python3-pip \
44-
python3-setuptools \
45-
python3-wheel \
4641
qt6-base-dev \
47-
qt6-declarative-dev \
4842
qt6-image-formats-plugins \
4943
qt6-l10n-tools \
5044
qt6-tools-dev \
@@ -55,15 +49,9 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
5549
zlib1g-dev \
5650
&& rm -rf /var/lib/apt/lists/*
5751

58-
# Set Python3 as default Python version
59-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100
60-
61-
# Allow installing pip packages system-wide since there's no risk in a container
62-
ENV PIP_BREAK_SYSTEM_PACKAGES=1
63-
6452
# Install Rust
6553
# Make .cargo/ writable for everyone to allow running the container as non-root.
66-
ARG RUST_VERSION="1.85.1"
54+
ARG RUST_VERSION="1.87.0"
6755
ENV RUSTUP_HOME="/.rustup" \
6856
CARGO_HOME="/.cargo" \
6957
PATH="/.cargo/bin:$PATH"
@@ -72,14 +60,21 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
7260
&& chmod 777 $RUSTUP_HOME \
7361
&& chmod 777 $CARGO_HOME
7462

75-
# Install sccache
76-
ARG SCCACHE_VERSION="0.8.2"
77-
ARG SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION/sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz"
78-
RUN wget -c "$SCCACHE_URL" -O /tmp.tar.gz \
79-
&& tar -zxf /tmp.tar.gz \
80-
&& cp "./sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl/sccache" /usr/local/bin/ \
81-
&& rm -rf "./sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl" \
82-
&& rm /tmp.tar.gz
63+
# Install UV
64+
# Set its python directory to a known, user-writable path to allow accessing the
65+
# python versions installed during docker build from within CI runs which are
66+
# run as non-root.
67+
ARG UV_VERSION="0.7.13"
68+
ARG UV_URL="https://github.com/astral-sh/uv/releases/download/$UV_VERSION/uv-x86_64-unknown-linux-gnu.tar.gz"
69+
ENV UV_PYTHON_INSTALL_DIR="/.uv/python"
70+
RUN wget -c "${UV_URL}" -O /tmp.tar.gz \
71+
&& tar -xzf /tmp.tar.gz --strip-components=1 -C /usr/local/bin/ \
72+
&& rm /tmp.tar.gz \
73+
&& mkdir -p $UV_PYTHON_INSTALL_DIR && chmod 777 $UV_PYTHON_INSTALL_DIR
74+
75+
# Pre-install a Python version
76+
ARG PYTHON_VERSION="3.13"
77+
RUN uv python install $PYTHON_VERSION
8378

8479
# LibrePCB's unittests expect that there is a USERNAME environment variable
8580
ENV USERNAME="root"

ubuntu-24.04/Dockerfile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,46 +27,31 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
2727
libocct-*-dev \
2828
libpolyclipping-dev \
2929
libpolyclipping22 \
30-
libqt6core5compat6-dev \
3130
libqt6opengl6-dev \
3231
libqt6openglwidgets6 \
3332
libqt6sql6-sqlite \
3433
libqt6svg6-dev \
35-
libquazip1-qt6-1t64 \
36-
libquazip1-qt6-dev \
3734
libtbb-dev \
3835
libxi-dev \
3936
make \
4037
ninja-build \
4138
occt-misc \
4239
openssl \
4340
pkg-config \
44-
python3 \
45-
python3-pip \
46-
python3-setuptools \
47-
python3-wheel \
4841
qt6-base-dev \
49-
qt6-declarative-dev \
5042
qt6-image-formats-plugins \
5143
qt6-l10n-tools \
5244
qt6-tools-dev \
5345
qt6-tools-dev-tools \
54-
sccache \
5546
wget \
5647
xvfb \
5748
zlib1g \
5849
zlib1g-dev \
5950
&& rm -rf /var/lib/apt/lists/*
6051

61-
# Set Python3 as default Python version
62-
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100
63-
64-
# Allow installing pip packages system-wide since there's no risk in a container
65-
ENV PIP_BREAK_SYSTEM_PACKAGES=1
66-
6752
# Install Rust
6853
# Make .cargo/ writable for everyone to allow running the container as non-root.
69-
ARG RUST_VERSION="1.85.1"
54+
ARG RUST_VERSION="1.87.0"
7055
ENV RUSTUP_HOME="/.rustup" \
7156
CARGO_HOME="/.cargo" \
7257
PATH="/.cargo/bin:$PATH"
@@ -75,5 +60,21 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
7560
&& chmod 777 $RUSTUP_HOME \
7661
&& chmod 777 $CARGO_HOME
7762

63+
# Install UV
64+
# Set its python directory to a known, user-writable path to allow accessing the
65+
# python versions installed during docker build from within CI runs which are
66+
# run as non-root.
67+
ARG UV_VERSION="0.7.13"
68+
ARG UV_URL="https://github.com/astral-sh/uv/releases/download/$UV_VERSION/uv-x86_64-unknown-linux-gnu.tar.gz"
69+
ENV UV_PYTHON_INSTALL_DIR="/.uv/python"
70+
RUN wget -c "${UV_URL}" -O /tmp.tar.gz \
71+
&& tar -xzf /tmp.tar.gz --strip-components=1 -C /usr/local/bin/ \
72+
&& rm /tmp.tar.gz \
73+
&& mkdir -p $UV_PYTHON_INSTALL_DIR && chmod 777 $UV_PYTHON_INSTALL_DIR
74+
75+
# Pre-install a Python version
76+
ARG PYTHON_VERSION="3.13"
77+
RUN uv python install $PYTHON_VERSION
78+
7879
# LibrePCB's unittests expect that there is a USERNAME environment variable
7980
ENV USERNAME="root"

0 commit comments

Comments
 (0)