Skip to content

Commit 3d8537e

Browse files
committed
use DSA rustup fetch script
1 parent cc581eb commit 3d8537e

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

dockerfiles/rust/1.75/Dockerfile

+34-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,37 @@
11
FROM ubuntu:22.04
22

3-
RUN apt-get update
4-
5-
# cargo 1.75.0 is latest version on apt as of 9/7/2024
6-
RUN apt install cargo=1.75.0+dfsg0ubuntu1~bpo0-0ubuntu0.22.04 -y
3+
ENV RUSTUP_HOME=/usr/local/rustup \
4+
CARGO_HOME=/usr/local/cargo \
5+
PATH=/usr/local/cargo/bin:$PATH \
6+
RUST_VERSION=1.75.0
77

8+
RUN set -eux; \
9+
apt-get update; \
10+
apt-get install -y --no-install-recommends \
11+
ca-certificates \
12+
gcc \
13+
libc6-dev \
14+
wget \
15+
; \
16+
dpkgArch="$(dpkg --print-architecture)"; \
17+
case "${dpkgArch##*-}" in \
18+
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db' ;; \
19+
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \
20+
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
21+
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \
22+
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
23+
esac; \
24+
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
25+
wget "$url"; \
26+
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
27+
chmod +x rustup-init; \
28+
./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION; \
29+
rm rustup-init; \
30+
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
31+
rustup --version; \
32+
cargo --version; \
33+
rustc --version; \
34+
apt-get remove -y --auto-remove \
35+
wget \
36+
; \
37+
rm -rf /var/lib/apt/lists/*;

0 commit comments

Comments
 (0)