Add mise language manager to dev images
- Install mise and activate it in root's zshrc in Fedora and Ubuntu - Add mise-data volume and mount at /root/.local/share/mise - Add mise --version check to the Makefile self-check target - Document mise-data volume in README - Add DB packages: postgresql/redis/mariadb to Fedora and postgresql-client/redis-tools/default-mysql-client to Ubuntu
This commit is contained in:
@@ -6,6 +6,7 @@ RUN dnf update -y && dnf install -y \
|
||||
gcc gcc-c++ make cmake openssl-devel jq tmux vim \
|
||||
zsh sudo python3 python3-pip \
|
||||
openssh-server tar gzip \
|
||||
postgresql redis mariadb \
|
||||
&& dnf clean all
|
||||
|
||||
|
||||
@@ -29,7 +30,11 @@ RUN curl -fsSL https://go.dev/dl/go1.24.4.linux-amd64.tar.gz | tar -C /usr/local
|
||||
# 4. 全局安装 AI 工具 (Vibe Coding 核心: opencode + oh-my-pi)
|
||||
RUN bun install -g opencode-ai @oh-my-pi/pi-coding-agent
|
||||
|
||||
# 5. SSH & ZSH 配置
|
||||
# 5. 安装 mise (多语言版本管理器,用于按需管理 Node/Python/Ruby 等)
|
||||
RUN curl -fsSL https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh \
|
||||
&& echo 'eval "$(mise activate zsh)"' >> /root/.zshrc
|
||||
|
||||
# 6. SSH & ZSH 配置
|
||||
RUN ssh-keygen -A && \
|
||||
mkdir -p /root/.zed /root/.local/share/zed && \
|
||||
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||
|
||||
@@ -5,6 +5,7 @@ RUN apt-get update && apt-get install -y \
|
||||
curl git wget unzip procps tar gzip shellcheck vim \
|
||||
gcc g++ make cmake libssl-dev tmux jq \
|
||||
zsh sudo python3 python3-pip openssh-server \
|
||||
postgresql-client redis-tools default-mysql-client \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 2. 环境变量
|
||||
@@ -26,13 +27,17 @@ RUN curl -fsSL https://go.dev/dl/go1.24.4.linux-amd64.tar.gz | tar -C /usr/local
|
||||
# 4. 全局安装 AI 工具 (opencode + oh-my-pi)
|
||||
RUN bun install -g opencode-ai @oh-my-pi/pi-coding-agent
|
||||
|
||||
# 5. SSH & 目录预设 (为 Zed 准备)
|
||||
# 5. 安装 mise (多语言版本管理器,用于按需管理 Node/Python/Ruby 等)
|
||||
RUN curl -fsSL https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh \
|
||||
&& echo 'eval "$(mise activate zsh)"' >> /root/.zshrc
|
||||
|
||||
# 6. SSH & 目录预设 (为 Zed 准备)
|
||||
RUN ssh-keygen -A && \
|
||||
mkdir -p /root/.zed /root/.local/share/zed && \
|
||||
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||
|
||||
RUN sed -i 's/#PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config
|
||||
# 6. Shell 美化
|
||||
# 7. Shell 美化
|
||||
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
||||
|
||||
# 接收来自 compose 的参数
|
||||
|
||||
@@ -69,6 +69,7 @@ check:
|
||||
@docker exec -it $(CONTAINER_NAME) bun --version || echo "❌ Bun 未就绪"
|
||||
@docker exec -it $(CONTAINER_NAME) opencode version || echo "❌ OpenCode 未就绪"
|
||||
@docker exec -it $(CONTAINER_NAME) omp --version || echo "❌ Oh My Pi 未就绪"
|
||||
@docker exec -it $(CONTAINER_NAME) mise --version || echo "❌ mise 未就绪"
|
||||
@echo "✨ 自检完成!"
|
||||
|
||||
add-key:
|
||||
|
||||
@@ -104,6 +104,7 @@ omp --model anthropic/sonnet-4.5
|
||||
* **Bun 依赖加速**:`bun-cache` 避免了重复下载 node_modules 依赖。
|
||||
* **Zed 启动加速**:`zed-server` 卷缓存了远程后端二进制文件。
|
||||
* **工具持久化**:通过 `bun -g` 安装的工具在容器重建后依然可用。
|
||||
* **mise 语言版本**:`mise-data` 卷保留了通过 `mise use` 安装的 Node/Python/Ruby 等语言版本。
|
||||
|
||||
|
||||
## 🧹 常用维护命令
|
||||
|
||||
@@ -33,6 +33,8 @@ services:
|
||||
- zed-share:/root/.local/share/zed
|
||||
# --- 新增:Oh My Pi 配置/记忆/OAuth 登录态持久化 ---
|
||||
- omp-data:/root/.omp
|
||||
# --- 新增:mise 多语言版本管理器数据持久化 ---
|
||||
- mise-data:/root/.local/share/mise
|
||||
stdin_open: true
|
||||
tty: true
|
||||
restart: always
|
||||
@@ -45,3 +47,4 @@ volumes:
|
||||
zed-server:
|
||||
zed-share:
|
||||
omp-data:
|
||||
mise-data:
|
||||
|
||||
Reference in New Issue
Block a user