docker-rusty-moon/Dockerfile
2022-05-05 17:56:48 +03:00

48 lines
1.6 KiB
Docker

# Refer to https://github.com/rust-lang/docker-rust-nightly/blob/master/debian-slim/Dockerfile
# Debian was the better choice and you're about to make a mistake
#ARG DEBIAN_VERSION
#FROM debian:${DEBIAN_VERSION}-slim
FROM ubuntu:latest
# rust paths
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 \
### essentials
ca-certificates gcc libc6-dev wget \
### crosscompiling
mingw-w64 \
### requirements for github.com/emilk/eframe_template
libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev \
; \
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 --profile minimal --default-toolchain nightly \
--target x86_64-pc-windows-gnu; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version; \
rustup target list; \
\
apt remove -y --auto-remove \
### ditch the wget who needs that
wget \
; \
### wipe apt cache
rm -rf /var/lib/apt/lists/*;