FROM alpine:3.12 RUN apk add --no-cache \ ca-certificates \ gcc ARG VERSION=1.48.0 ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ RUST_VERSION=${VERSION} RUN set -eux; \ apkArch="$(apk --print-arch)"; \ case "$apkArch" in \ x86_64) rustArch='x86_64-unknown-linux-musl'; rustupSha256='8ab4f7759e22c308b49d737b5dc055c0d334f730632fdc6a169eda033983b846' ;; \ aarch64) rustArch='aarch64-unknown-linux-musl'; rustupSha256='b3f15d01db21e4e9f192a81bfcbbb72e9055f6b01b4d0893b24f9f6c9f9d2b92' ;; \ *) echo >&2 "unsupported architecture: $apkArch"; exit 1 ;; \ esac; \ url="https://static.rust-lang.org/rustup/archive/1.23.0/${rustArch}/rustup-init"; \ wget "$url"; \ echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ chmod +x rustup-init; \ ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ rm rustup-init; \ chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ rustup --version; \ cargo --version; \ rustc --version;