Skip to content

Commit 4566dbd

Browse files
authored
Merge pull request #57 from LibrePCB/update-rust
Update Rust to 1.85.0 in all Ubuntu images
2 parents 281de36 + 6b2e322 commit 4566dbd

4 files changed

Lines changed: 44 additions & 18 deletions

File tree

devtools/Dockerfile

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ FROM ubuntu:24.04
33
# Install APT packages
44
RUN apt-get -q update \
55
&& apt-get -qy install \
6-
# Documentation tools: Doxygen, Graphviz, qhelpgenerator, rustdoc
6+
# Documentation tools: Doxygen, Graphviz, qhelpgenerator
77
doxygen \
88
graphviz \
99
qt6-documentation-tools \
10-
rustc \
11-
# Formatting tools: clang-format, qmlformat, rustfmt, xmlsort
10+
# Formatting tools: clang-format, qmlformat, xmlsort
1211
clang-format-15 \
1312
libxml-filter-sort-perl \
14-
rustfmt \
1513
qt6-declarative-dev-tools \
16-
# Stylecheck tools: git, rust-clippy
14+
# Stylecheck tools: git
1715
git \
18-
rust-clippy \
1916
# Python for custom formatting scripts, flake8 etc.
2017
python3 \
2118
python3-debian \
@@ -33,6 +30,17 @@ RUN update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/cl
3330
# Put qhelpgenerator in PATH
3431
RUN ln -s /usr/lib/qt6/libexec/qhelpgenerator /usr/local/bin/qhelpgenerator
3532

33+
# Install Rust, including rustdoc, rustfmt, rust-clippy
34+
# Make .cargo/ writable for everyone to allow running the container as non-root.
35+
ARG RUST_VERSION="1.85.0"
36+
ENV RUSTUP_HOME="/.rustup" \
37+
CARGO_HOME="/.cargo" \
38+
PATH="/.cargo/bin:$PATH"
39+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
40+
| sh -s -- -y --default-toolchain $RUST_VERSION --no-modify-path \
41+
&& chmod 777 $RUSTUP_HOME \
42+
&& chmod 777 $CARGO_HOME
43+
3644
# Install Python packages
3745
ENV PIP_BREAK_SYSTEM_PACKAGES=1
3846
RUN pip3 install \

ubuntu-20.04-qt6.6/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ARG DEBIAN_FRONTEND=noninteractive
55
RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
66
bzip2 \
77
ca-certificates \
8-
cargo \
98
ccache \
109
clang \
1110
curl \
@@ -47,7 +46,6 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
4746
python3-pip \
4847
python3-setuptools \
4948
python3-wheel \
50-
rustc \
5149
software-properties-common \
5250
wget \
5351
xvfb \
@@ -66,8 +64,16 @@ RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 100
6664
# Allow installing pip packages system-wide since there's no risk in a container
6765
ENV PIP_BREAK_SYSTEM_PACKAGES=1
6866

69-
# Make .cargo/ writable for everyone to allow running the container as non-root
70-
RUN mkdir /.cargo && chmod 777 /.cargo
67+
# Install Rust
68+
# Make .cargo/ writable for everyone to allow running the container as non-root.
69+
ARG RUST_VERSION="1.85.0"
70+
ENV RUSTUP_HOME="/.rustup" \
71+
CARGO_HOME="/.cargo" \
72+
PATH="/.cargo/bin:$PATH"
73+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
74+
| sh -s -- -y --default-toolchain $RUST_VERSION --profile minimal --no-modify-path \
75+
&& chmod 777 $RUSTUP_HOME \
76+
&& chmod 777 $CARGO_HOME
7177

7278
# Install CMake
7379
ARG CMAKE_VERSION="3.31.1"

ubuntu-22.04/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ARG DEBIAN_FRONTEND=noninteractive
55
RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
66
bzip2 \
77
ca-certificates \
8-
cargo \
98
ccache \
109
clang \
1110
cmake \
@@ -49,7 +48,6 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
4948
qt6-l10n-tools \
5049
qt6-tools-dev \
5150
qt6-tools-dev-tools \
52-
rustc \
5351
wget \
5452
xvfb \
5553
zlib1g \
@@ -62,8 +60,16 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100
6260
# Allow installing pip packages system-wide since there's no risk in a container
6361
ENV PIP_BREAK_SYSTEM_PACKAGES=1
6462

65-
# Make .cargo/ writable for everyone to allow running the container as non-root
66-
RUN mkdir /.cargo && chmod 777 /.cargo
63+
# Install Rust
64+
# Make .cargo/ writable for everyone to allow running the container as non-root.
65+
ARG RUST_VERSION="1.85.0"
66+
ENV RUSTUP_HOME="/.rustup" \
67+
CARGO_HOME="/.cargo" \
68+
PATH="/.cargo/bin:$PATH"
69+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
70+
| sh -s -- -y --default-toolchain $RUST_VERSION --profile minimal --no-modify-path \
71+
&& chmod 777 $RUSTUP_HOME \
72+
&& chmod 777 $CARGO_HOME
6773

6874
# Install sccache
6975
ARG SCCACHE_VERSION="0.8.2"

ubuntu-24.04/Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ ARG DEBIAN_FRONTEND=noninteractive
55
RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
66
bzip2 \
77
ca-certificates \
8-
cargo \
98
ccache \
109
clang \
1110
cmake \
@@ -51,7 +50,6 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
5150
qt6-l10n-tools \
5251
qt6-tools-dev \
5352
qt6-tools-dev-tools \
54-
rustc \
5553
sccache \
5654
wget \
5755
xvfb \
@@ -65,8 +63,16 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 100
6563
# Allow installing pip packages system-wide since there's no risk in a container
6664
ENV PIP_BREAK_SYSTEM_PACKAGES=1
6765

68-
# Make .cargo/ writable for everyone to allow running the container as non-root
69-
RUN mkdir /.cargo && chmod 777 /.cargo
66+
# Install Rust
67+
# Make .cargo/ writable for everyone to allow running the container as non-root.
68+
ARG RUST_VERSION="1.85.0"
69+
ENV RUSTUP_HOME="/.rustup" \
70+
CARGO_HOME="/.cargo" \
71+
PATH="/.cargo/bin:$PATH"
72+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
73+
| sh -s -- -y --default-toolchain $RUST_VERSION --profile minimal --no-modify-path \
74+
&& chmod 777 $RUSTUP_HOME \
75+
&& chmod 777 $CARGO_HOME
7076

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

0 commit comments

Comments
 (0)