Dockerfile 893 B

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