-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
83 lines (71 loc) · 2.61 KB
/
Dockerfile
File metadata and controls
83 lines (71 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM node:22-slim
# 设置环境变量 | Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# 安装依赖 | Install dependencies
RUN apt update && apt install -y --no-install-recommends curl ca-certificates && update-ca-certificates
RUN curl -LO https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc_latest-1_amd64.deb
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& apt install -y --no-install-recommends \
bash \
nano \
chromium \
wget \
fonts-liberation \
fonts-noto-cjk \
fonts-noto-color-emoji \
gnupg \
git \
gosu \
jq \
python3 \
python3-pip \
build-essential \
unzip \
pandoc \
socat \
tini \
websockify \
gh \
texlive-base \
texlive-binaries \
texlive-latex-base \
texlive-fonts-recommended \
texlive-latex-recommended \
texlive-lang-chinese \
texlive-latex-extra \
nix-setup-systemd \
&& apt install -y ./chsrc_latest-1_amd64.deb \
&& apt autoremove -y \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* \
&& usermod -aG nix-users node
RUN rm ./chsrc_latest-1_amd64.deb
# 复制启动脚本 | Copy entrypoint
COPY scripts/entrypoint.bash /usr/local/bin/entrypoint.bash
RUN chmod +x /usr/local/bin/entrypoint.bash
# 设置工作目录为 home | Set the working directory to home
# WORKDIR /home/node
WORKDIR /root
# VOLUME /home/node
VOLUME /root
# 切换到 node 用户 | Switch to the node user
# USER node
# PATH
ENV PATH="/root/.cargo/bin:/root/.local/bin:/root/.opencode/bin:${PATH}"
# 安装 OpenCode | Install OpenCode from npm
RUN mkdir -p /root/.local/share/opencode
RUN curl -fsSL https://opencode.ai/install | bash
RUN test -x /root/.opencode/bin/opencode && echo "OpenCode installed successfully" || (echo "OpenCode installation failed" && exit 1)
# 安装 x-cmd | Install x-cmd
RUN eval "$(curl https://get.x-cmd.com)"
# 安装 Rust | Install Rust toolchain
RUN curl -sSf https://sh.rustup.rs --output rustup-init && \
sh rustup-init -y && \
rm rustup-init && \
rustup component add rustfmt clippy
# 复制 nano 配置 | Copy .nanorc
COPY .nanorc /root/.nanorc
# 使用 tini 作为 init 进程,运行 entrypoint.sh | User tini as ini to start entrypoint
ENTRYPOINT ["tini", "--", "/usr/local/bin/entrypoint.bash"]