docker-rusty-moon/Dockerfile

47 lines
1.6 KiB
Docker
Raw 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
# - BASED? BASED ON WHAT?
# - based on Ubuntu 22.04 LTS «Jammy Jellyfish»
2022-05-05 08:13:38 +00:00
FROM ubuntu:jammy
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:39:54 +00:00
ca-certificates gcc libc6-dev wget \
### https://github.com/emilk/eframe_template requirements
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 08:39:54 +00:00
./rustup-init -y --no-modify-path --default-toolchain nightly \
--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:44:25 +00:00
rustup toolchain 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/*;