AgentSkillsCN

docker-sandbox

针对 dotfiles 管理 Docker 沙盒环境。当用户提到“构建 Docker”、“启动容器”、“进入 Shell”、“清理容器”、“检查状态”、“制作构建”、“进入 Shell”、“执行清理”、开发环境,或容器管理等相关操作时,此方法大有裨益。

SKILL.md
--- frontmatter
name: docker-sandbox
description: Docker sandbox environment management for dotfiles. Use when user mentions "build docker", "start container", "enter shell", "clean container", "check status", "make build", "make shell", "make clean", development environment, or container management.

Docker Sandbox Management

dotfilesをテストするためのDocker開発環境を管理する。

Available Commands

CommandDescription
make buildBuild Docker image
make startStart container in background
make shellAttach to container (auto-starts if needed)
make runRun temporary container (removed after exit)
make stopStop container
make cleanRemove container and volume
make statusShow current worktree status
make listList all dotfiles containers

Common Workflows

Initial Setup

bash
make build   # Build image
make shell   # Enter development environment

Test Configuration Changes

After editing dotfiles on host:

bash
make shell
# Inside container:
source ~/.zshrc              # Reload zsh
tmux source ~/.tmux.conf     # Reload tmux (inside tmux)
:source $MYVIMRC             # Reload neovim (inside nvim)

Reset Environment

bash
make clean   # Remove container and volume
make build   # Rebuild image
make shell   # Enter fresh environment

Container Architecture

  • Image: dotfiles:{worktree-name}
  • Container: dotfiles-{worktree-name}
  • Volume: dotfiles-{worktree-name}-home (persists home directory)
  • Mount: ~/.dotfiles (read-only)

Included Tools

  • Neovim (stable)
  • tmux 3.5
  • zsh
  • Node.js (latest LTS)
  • Python3 + pynvim

Troubleshooting

Container won't start

  1. Check status: make status
  2. View logs: docker logs dotfiles-{worktree-name}
  3. Rebuild: make clean && make build

Changes not reflected

dotfiles are mounted read-only. Edit on host, then reload inside container.