#ARG DEBIAN_VERSION #FROM debian:${DEBIAN_VERSION}-slim FROM ubuntu:jammy ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH RUN set -eux; \ apt update; \ apt install -y --no-install-recommends \ ca-certificates \ gcc \ libc6-dev \ wget \ ; \ dpkgArch="$(dpkg --print-architecture)"; \ case "${dpkgArch##*-}" in \ amd64) rustArch='x86_64-unknown-linux-gnu' ;; \ arm64) rustArch='aarch64-unknown-linux-gnu' ;; \ *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ esac; \ \ url="https://static.rust-lang.org/rustup/dist/${rustArch}/rustup-init"; \ wget "$url"; \ chmod +x rustup-init; \ ./rustup-init -y --no-modify-path --default-toolchain nightly; \ rm rustup-init; \ chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ rustup --version; \ cargo --version; \ rustc --version; \ \ apt remove -y --auto-remove \ wget \ ; \ rm -rf /var/lib/apt/lists/*;