1415e46eaSLoGinFROM ubuntu:jammy 2415e46eaSLoGin 3415e46eaSLoGin# 设置环境变量 4415e46eaSLoGinENV TZ=Asia/Shanghai 5056c4aadSLoGinENV RUSTUP_DIST_SERVER=https://static.rust-lang.org 6056c4aadSLoGinENV RUSTUP_UPDATE_ROOT=https://static.rust-lang.org/rustup 7*79eda4bcSLoGinENV FORCE_UNSAFE_CONFIGURE=1 8*79eda4bcSLoGin 9415e46eaSLoGinRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone 105ed4cd46Sguanjinquan 115ed4cd46Sguanjinquan# 设置工作目录 12415e46eaSLoGinWORKDIR /tmp 135ed4cd46Sguanjinquan 145ed4cd46Sguanjinquan# 将本地的脚本复制到工作目录 155ed4cd46SguanjinquanCOPY *.sh ./ 165ed4cd46Sguanjinquan 17415e46eaSLoGin# 设置sudo免密码 18415e46eaSLoGinRUN apt update && \ 19415e46eaSLoGin apt install -y ca-certificates curl gnupg wget sudo apt-utils && \ 20415e46eaSLoGin bash bootstrap.sh --default && \ 21415e46eaSLoGin sudo cp /tmp/docker-entrypoint.sh /root/entrypoint.sh && \ 22415e46eaSLoGin sudo chmod a+rwx /root/entrypoint.sh && \ 23*79eda4bcSLoGin git config --global --add safe.directory '*' && \ 24415e46eaSLoGin sudo apt autoremove -q -y && \ 25415e46eaSLoGin sudo apt clean -q -y && \ 26415e46eaSLoGin sudo rm -rf /tmp/* 275ed4cd46Sguanjinquan 28415e46eaSLoGinWORKDIR /root 295ed4cd46Sguanjinquan 30415e46eaSLoGinENTRYPOINT [ "/root/entrypoint.sh" ] 315ed4cd46Sguanjinquan# 设置容器启动后执行的命令 325ed4cd46SguanjinquanCMD ["/bin/bash"] 33