Compare commits

..

2 Commits

Author SHA1 Message Date
dc947beafa Add Go support to dev containers and Makefile 2026-02-25 14:07:16 +08:00
d04243817e Add shellcheck, tmux, and jq to dev Dockerfiles 2026-01-10 20:42:44 +08:00
4 changed files with 23 additions and 11 deletions

View File

@@ -2,8 +2,8 @@ FROM fedora:latest
# 1. 系统工具与编译环境
RUN dnf update -y && dnf install -y \
curl git wget unzip procps-ng \
gcc gcc-c++ make cmake openssl-devel \
curl git wget unzip procps-ng shellcheck\
gcc gcc-c++ make cmake openssl-devel jq tmux vim\
zsh sudo python3 python3-pip \
openssh-server tar gzip \
&& dnf clean all
@@ -12,14 +12,18 @@ RUN dnf update -y && dnf install -y \
# 2. 环境变量配置
ENV CARGO_HOME=/usr/local/cargo \
RUSTUP_HOME=/usr/local/rustup \
BUN_INSTALL="/root/.bun"
ENV PATH="$BUN_INSTALL/bin:/usr/local/cargo/bin:${PATH}"
BUN_INSTALL="/root/.bun" \
GOPATH="/root/go"
ENV PATH="$BUN_INSTALL/bin:/usr/local/cargo/bin:/usr/local/go/bin:$GOPATH/bin:${PATH}"
RUN chsh -s /bin/zsh root
# 3. 安装 Rust & Bun
# 3. 安装 Rust & Bun & Go
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN curl -fsSL https://bun.sh/install | bash
RUN curl -fsSL https://go.dev/dl/go1.24.4.linux-amd64.tar.gz | tar -C /usr/local -xzf - \
&& go install golang.org/x/tools/gopls@latest \
&& go install github.com/go-delve/delve/cmd/dlv@latest
# 4. 全局安装 AI 工具 (Vibe Coding 核心)
RUN bun install -g opencode-ai

View File

@@ -2,21 +2,25 @@ FROM fedora:latest
# 1. 基础工具 (包含 Zed 远程运行所需的 procps-ng, tar)
RUN dnf update -y && dnf install -y \
curl git wget unzip procps-ng tar gzip \
gcc gcc-c++ make cmake openssl-devel \
curl git wget unzip procps-ng tar gzip shellcheck vim\
gcc gcc-c++ make cmake openssl-devel tmux jq\
zsh sudo python3 python3-pip openssh-server \
&& dnf clean all
# 2. 环境变量
ENV CARGO_HOME=/usr/local/cargo \
RUSTUP_HOME=/usr/local/rustup \
BUN_INSTALL="/root/.bun"
ENV PATH="$BUN_INSTALL/bin:/usr/local/cargo/bin:${PATH}"
BUN_INSTALL="/root/.bun" \
GOPATH="/root/go"
ENV PATH="$BUN_INSTALL/bin:/usr/local/cargo/bin:/usr/local/go/bin:$GOPATH/bin:${PATH}"
RUN chsh -s /bin/zsh root
# 3. 安装 Rust & Bun
# 3. 安装 Rust & Bun & Go
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN curl -fsSL https://bun.sh/install | bash
RUN curl -fsSL https://go.dev/dl/go1.24.4.linux-amd64.tar.gz | tar -C /usr/local -xzf - \
&& go install golang.org/x/tools/gopls@latest \
&& go install github.com/go-delve/delve/cmd/dlv@latest
# 4. 全局安装 AI 工具
RUN bun install -g opencode-ai

View File

@@ -30,6 +30,7 @@ restart: down up
build:
@echo "🛠️ 正在重新构建镜像..."
docker compose build --no-cache
docker compose down
docker compose up -d
# --- 连接与交互 ---
@@ -64,6 +65,7 @@ logs:
check:
@echo "🔍 执行工具自检..."
@docker exec -it $(CONTAINER_NAME) rustc --version || echo "❌ Rust 未就绪"
@docker exec -it $(CONTAINER_NAME) go version || echo "❌ Go 未就绪"
@docker exec -it $(CONTAINER_NAME) bun --version || echo "❌ Bun 未就绪"
@docker exec -it $(CONTAINER_NAME) aider --version || echo "❌ Aider 未就绪"
@docker exec -it $(CONTAINER_NAME) opencode version || echo "❌ OpenCode 未就绪"

View File

@@ -3,7 +3,7 @@ services:
build:
context: .
# 根据需要切换 Dockerfile.fedora 或 Dockerfile.ubuntu
dockerfile: Dockerfile.fedora
dockerfile: Dockerfile.fedora
args:
# 将路径传递给 Dockerfile 阶段
CONTAINER_WORKSPACE: ${CONTAINER_WORKSPACE_PATH:-/workspace}
@@ -27,6 +27,7 @@ services:
- ${SSH_PUB_KEY_PATH:-~/.ssh/id_ed25519.pub}:/tmp/host_id_ed25519.pub:ro
- cargo-cache:/usr/local/cargo/registry
- bun-cache:/root/.bun/install/cache
- go-cache:/root/go
# --- 新增Zed 远程开发缓存 ---
- zed-server:/root/.zed_server
- zed-share:/root/.local/share/zed
@@ -38,5 +39,6 @@ volumes:
ssh-data:
cargo-cache:
bun-cache:
go-cache:
zed-server:
zed-share: