@@ -4,7 +4,9 @@ ARG TARGETOS
4
4
ARG TARGETARCH
5
5
6
6
# Install Node.js
7
- RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
7
+ RUN apt-get update \
8
+ && apt-get install -y --no-install-recommends curl ca-certificates gnupg \
9
+ && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
8
10
&& apt-get update \
9
11
&& apt-get install -y --no-install-recommends nodejs \
10
12
&& apt-get clean \
@@ -18,21 +20,24 @@ ENV RUSTUP_HOME=/usr/local/rustup \
18
20
19
21
# Install Rust
20
22
RUN set -eux; \
21
- dpkgArch="$(dpkg --print-architecture)" ; \
22
- case "${dpkgArch##*-}" in \
23
- amd64) rustArch='x86_64-unknown-linux-gnu' ; rustupSha256='0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db' ;; \
24
- armhf) rustArch='armv7-unknown-linux-gnueabihf' ; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \
25
- arm64) rustArch='aarch64-unknown-linux-gnu' ; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
26
- i386) rustArch='i686-unknown-linux-gnu' ; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \
27
- *) echo >&2 "unsupported architecture: ${dpkgArch}" ; exit 1 ;; \
28
- esac; \
29
- url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init" ; \
30
- wget "$url" ; \
31
- echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
32
- chmod +x rustup-init; \
33
- ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \
34
- rm rustup-init; \
35
- chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
23
+ dpkgArch="$(dpkg --print-architecture)" || exit 1; \
24
+ if [ "${dpkgArch}" = "amd64" ]; then \
25
+ rustArch="x86_64-unknown-linux-gnu" ; rustupSha256="0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db" ; \
26
+ elif [ "${dpkgArch}" = "armhf" ]; then \
27
+ rustArch="armv7-unknown-linux-gnueabihf" ; rustupSha256="f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a" ; \
28
+ elif [ "${dpkgArch}" = "arm64" ]; then \
29
+ rustArch="aarch64-unknown-linux-gnu" ; rustupSha256="673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800" ; \
30
+ elif [ "${dpkgArch}" = "i386" ]; then \
31
+ rustArch="i686-unknown-linux-gnu" ; rustupSha256="e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333" ; \
32
+ else \
33
+ echo "unsupported architecture: ${dpkgArch}" >&2; exit 1; \
34
+ fi; \
35
+ wget "https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init" -O /tmp/rustup-init; \
36
+ echo "${rustupSha256} */tmp/rustup-init" | sha256sum -c -; \
37
+ chmod +x /tmp/rustup-init; \
38
+ /tmp/rustup-init -y --no-modify-path --profile minimal --default-toolchain "$RUST_VERSION" --default-host "$rustArch" ; \
39
+ rm /tmp/rustup-init; \
40
+ chmod -R a+w "$RUSTUP_HOME" "$CARGO_HOME" ; \
36
41
rustup --version; \
37
42
cargo --version; \
38
43
rustc --version
0 commit comments