-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.rustc
42 lines (37 loc) · 1.29 KB
/
Dockerfile.rustc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM linuxdeepin/deepin:beige-loong64-v1.4.0
ARG RUSTUP_VERSION="1.27.1" \
HOST_RUST_VERSION="1.80.1" \
TARGET_RUST_BRANCH="1.81.0"
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'deb https://mirrors.ustc.edu.cn/deepin/beige beige main commercial community' > /etc/apt/sources.list && \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
cmake \
python3 \
ninja-build \
libffi-dev \
libssl-dev \
build-essential \
pkg-config
WORKDIR /root
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
RUN curl "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/loongarch64-unknown-linux-gnu/rustup-init" -o rustup-init && \
chmod +x rustup-init && \
./rustup-init -y --default-toolchain "${HOST_RUST_VERSION}" --profile minimal --no-modify-path && \
rm rustup-init
RUN git clone --depth 1 --branch "${TARGET_RUST_BRANCH}" https://github.com/rust-lang/rust.git
WORKDIR /root/rust
ADD config.toml .
ENV CFLAGS="-fPIC" \
CXXFLAGS="-fPIC" \
LDFLAGS="-fPIC" \
RUSTFLAGS="-C code-model=large" \
LIBGIT2_NO_PKG_CONFIG=1 \
RUST_BACKTRACE=1
RUN mkdir /root/target && \
./x dist && \
./x install && \
tar czf rustc.tar.gz --directory=/root/target .