docker-rusty-moon/Dockerfile

48 lines
1.6 KiB
Docker
Raw Permalink Normal View History

2022-05-05 08:39:54 +00:00
# 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
2022-05-05 08:06:26 +00:00
#ARG DEBIAN_VERSION
#FROM debian:${DEBIAN_VERSION}-slim
2022-05-05 08:39:54 +00:00
2022-05-05 08:58:53 +00:00
FROM ubuntu:latest
2022-05-05 08:00:16 +00:00
2022-05-05 08:39:54 +00:00
# rust paths
2022-05-05 08:00:16 +00:00
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
2022-05-05 08:39:54 +00:00
2022-05-05 08:00:16 +00:00
RUN set -eux; \
2022-05-05 08:13:38 +00:00
apt update; \
apt install -y --no-install-recommends \
2022-05-05 08:51:19 +00:00
### essentials
2022-05-05 08:39:54 +00:00
ca-certificates gcc libc6-dev wget \
2022-05-05 08:51:19 +00:00
### crosscompiling
mingw-w64 \
### requirements for github.com/emilk/eframe_template
2022-05-05 08:41:10 +00:00
libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev \
2022-05-05 08:00:16 +00:00
; \
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; \
2022-05-05 14:56:48 +00:00
./rustup-init -y --no-modify-path --profile minimal --default-toolchain nightly \
2022-05-05 08:39:54 +00:00
--target x86_64-pc-windows-gnu; \
2022-05-05 08:00:16 +00:00
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version; \
2022-05-05 08:58:53 +00:00
rustup target list; \
2022-05-05 08:00:16 +00:00
\
2022-05-05 08:13:38 +00:00
apt remove -y --auto-remove \
2022-05-05 08:39:54 +00:00
### ditch the wget who needs that
2022-05-05 08:00:16 +00:00
wget \
; \
2022-05-05 08:39:54 +00:00
### wipe apt cache
2022-05-05 08:00:16 +00:00
rm -rf /var/lib/apt/lists/*;