Dockerfile 698 B

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