xref: /DragonOS/tools/Dockerfile (revision fae6e9ade46a52976ad5d099643d51cc20876448)
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
7ENV FORCE_UNSAFE_CONFIGURE=1
8
9RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
10
11# 设置工作目录
12WORKDIR /tmp
13
14# 将本地的脚本复制到工作目录
15COPY *.sh ./
16
17# 设置sudo免密码
18RUN apt update && \
19    apt install -y ca-certificates curl gnupg wget sudo apt-utils && \
20    bash bootstrap.sh --default && \
21    sudo cp /tmp/docker-entrypoint.sh /root/entrypoint.sh && \
22    sudo chmod a+rwx /root/entrypoint.sh && \
23    git config --global --add safe.directory '*' && \
24    sudo apt autoremove -q -y && \
25    sudo apt clean -q -y && \
26    sudo rm -rf /tmp/*
27
28WORKDIR /root
29
30ENTRYPOINT [ "/root/entrypoint.sh" ]
31# 设置容器启动后执行的命令
32CMD ["/bin/bash"]
33