1FROM ubuntu:jammy 2 3# 设置环境变量 4ENV TZ=Asia/Shanghai 5ENV RUSTUP_DIST_SERVER=https://static.rust-lang.org 6ENV RUSTUP_UPDATE_ROOT=https://static.rust-lang.org/rustup 7RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 8 9# 设置工作目录 10WORKDIR /tmp 11 12# 将本地的脚本复制到工作目录 13COPY *.sh ./ 14 15# 设置sudo免密码 16RUN apt update && \ 17 apt install -y ca-certificates curl gnupg wget sudo apt-utils && \ 18 bash bootstrap.sh --default && \ 19 sudo cp /tmp/docker-entrypoint.sh /root/entrypoint.sh && \ 20 sudo chmod a+rwx /root/entrypoint.sh && \ 21 sudo apt autoremove -q -y && \ 22 sudo apt clean -q -y && \ 23 sudo rm -rf /tmp/* 24 25WORKDIR /root 26 27ENTRYPOINT [ "/root/entrypoint.sh" ] 28# 设置容器启动后执行的命令 29CMD ["/bin/bash"] 30