Install opencode and omp with Bun
- Combine Bun installs for opencode-ai and @oh-my-pi/pi-coding-agent - Make Makefile include .env optional and silence sed errors
This commit is contained in:
@@ -25,12 +25,11 @@ ENV PATH="$BUN_INSTALL/bin:$PATH"
|
|||||||
# 安装 Bun
|
# 安装 Bun
|
||||||
RUN curl -fsSL https://bun.sh/install | bash
|
RUN curl -fsSL https://bun.sh/install | bash
|
||||||
|
|
||||||
# 使用 Bun 安装 opencode
|
# 使用 Bun 安装 opencode 与 oh-my-pi (omp)
|
||||||
RUN bun install -g opencode-ai
|
# - opencode: Vibe Coding 工具
|
||||||
|
# - omp: 终端 AI 编码 agent,原生支持 Zed (ACP 协议)
|
||||||
# 安装 oh-my-pi (omp) - 终端 AI 编码 agent,原生支持 Zed (ACP 协议)
|
|
||||||
# 配置目录 ~/.omp/ 由 compose.yml 中 /root 挂载卷持久化
|
# 配置目录 ~/.omp/ 由 compose.yml 中 /root 挂载卷持久化
|
||||||
RUN bun install -g @oh-my-pi/pi-coding-agent
|
RUN bun install -g opencode-ai @oh-my-pi/pi-coding-agent
|
||||||
|
|
||||||
# 3. 配置 SSH 服务
|
# 3. 配置 SSH 服务
|
||||||
RUN mkdir /var/run/sshd && \
|
RUN mkdir /var/run/sshd && \
|
||||||
@@ -39,18 +38,9 @@ RUN mkdir /var/run/sshd && \
|
|||||||
# 修复 SSH 登录后的环境变量问题
|
# 修复 SSH 登录后的环境变量问题
|
||||||
sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd
|
sed -i 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' /etc/pam.d/sshd
|
||||||
|
|
||||||
|
# 4. 设置工作目录
|
||||||
# 5. 安装 Opencode (Vibe Coding 工具)
|
|
||||||
# 假设 Opencode 是一个可以通过 curl 下载的二进制文件。
|
|
||||||
# 请将下方的 URL 替换为 Opencode 的真实下载链接。
|
|
||||||
# 如果 Opencode 是 npm 包,则需要先安装 nodejs。
|
|
||||||
# 这里演示二进制安装模式:
|
|
||||||
# RUN curl -L "https://path/to/opencode-linux-x64" -o /usr/local/bin/opencode && \
|
|
||||||
# chmod +x /usr/local/bin/opencode
|
|
||||||
|
|
||||||
# 6. 设置工作目录
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
# 7. 配置容器启动命令
|
# 5. 配置容器启动命令
|
||||||
# 启动 SSH 服务并挂起容器
|
# 启动 SSH 服务并挂起容器
|
||||||
CMD ["/bin/sh", "-c", "/usr/sbin/sshd -D"]
|
CMD ["/bin/sh", "-c", "/usr/sbin/sshd -D"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# 引用 .env 文件中的变量
|
# 引用 .env 文件中的变量(文件不存在时也不报错)
|
||||||
include .env
|
-include .env
|
||||||
export $(shell sed 's/=.*//' .env)
|
export $(shell sed 's/=.*//' .env 2>/dev/null)
|
||||||
|
|
||||||
.PHONY: help build up down restart logs shell clean ssh
|
.PHONY: help build up down restart logs shell clean ssh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user