forked from luoliwoshang/codeagent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (33 loc) · 1.85 KB
/
Dockerfile
File metadata and controls
44 lines (33 loc) · 1.85 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
FROM node:24-bookworm
# 添加用户
RUN groupadd -g 24368 codeagent && useradd -u 24368 -g 24368 -m codeagent
# 安装 Claude Code 和 Gemini CLI
RUN npm install -g @anthropic-ai/claude-code @google/gemini-cli
# 安装 toolkit
RUN apt-get update && apt-get install -y tree jq fd-find ripgrep git-lfs
RUN npm install -g @ast-grep/cli
# 安装 Go
RUN curl -fsSL https://go.dev/dl/go1.24.5.linux-amd64.tar.gz | tar -xz -C /usr/local
ENV PATH=/usr/local/go/bin:$PATH
# 安装 XGo
RUN echo "deb [trusted=yes] https://pkgs.xgo.dev/apt/ /" | tee /etc/apt/sources.list.d/goplus.list
RUN apt-get update && apt-get install -y xgo
# 安装 LLGo
RUN echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-19 main" | tee /etc/apt/sources.list.d/llvm.list
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-get update && apt-get install -y llvm-19-dev clang-19 libclang-19-dev lld-19 libunwind-19-dev libc++-19-dev pkg-config libgc-dev libssl-dev zlib1g-dev libcjson-dev libsqlite3-dev libuv1-dev python3.11-dev
RUN git clone https://github.com/goplus/llgo.git /tmp/llgo && cd /tmp/llgo && git checkout v0.11.5 && GOBIN=/usr/local/bin go install ./cmd/llgo && rm -rf /tmp/llgo
# 安装 GitHub CLI
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-get update \
&& apt-get install -y gh
# 清理缓存
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# 切换用户
USER codeagent
# 设置工作目录
WORKDIR /workspace
# 默认命令
CMD ["tail", "-f", "/dev/null"]