设置apt源
All checks were successful
build / build-rust (push) Successful in 7m38s

This commit is contained in:
soul-walker 2024-09-23 16:15:51 +08:00
parent a917453834
commit b42b941df1

View File

@ -2,6 +2,10 @@
# 用于构建 Rust 项目的镜像 # 用于构建 Rust 项目的镜像
FROM node:16-bullseye FROM node:16-bullseye
# 更换apt源为国内阿里云镜像
RUN sed -i 's|http://deb.debian.org/debian|http://mirrors.aliyun.com/debian|g' /etc/apt/sources.list && \
sed -i 's|http://deb.debian.org/debian-security|http://mirrors.aliyun.com/debian-security|g' /etc/apt/sources.list && \
cat /etc/apt/sources.list
RUN export RUSTUP_DIST_SERVER="https://rsproxy.cn" && export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" RUN export RUSTUP_DIST_SERVER="https://rsproxy.cn" && export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"
RUN apt-get update && apt-get install -y openssl libssl-dev musl-tools && curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh -s -- -y RUN apt-get update && apt-get install -y openssl libssl-dev musl-tools && curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}" ENV PATH="/root/.cargo/bin:${PATH}"