Skip to content

feat(docker): pre-install essential dev tools in minimal image#1304

Closed
darrenzeng2025 wants to merge 3 commits intosipeed:mainfrom
darrenzeng2025:feat/docker-dev-tools
Closed

feat(docker): pre-install essential dev tools in minimal image#1304
darrenzeng2025 wants to merge 3 commits intosipeed:mainfrom
darrenzeng2025:feat/docker-dev-tools

Conversation

@darrenzeng2025
Copy link
Copy Markdown
Contributor

📝 Description

This PR adds essential development tools to the minimal Docker image ().

Tools Added:

  • curl: HTTP requests and health checks
  • jq: JSON processing (essential for API interactions)
  • git: Version control for skills and repositories
  • python3 + py3-pip: Python script support for various tools
  • bash: Better shell scripting support

Why:

The current minimal image only contains , , and . Many PicoClaw skills and MCP tools require additional utilities like 用法:git [--version] [--help] [-C ] [-c =]
[--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree=] [--namespace=]
[]

这些是各种场合常见的 Git 命令:

开始一个工作区(参见:git help tutorial)
clone 克隆仓库到一个新目录
init 创建一个空的 Git 仓库或重新初始化一个已存在的仓库

在当前变更上工作(参见:git help everyday)
add 添加文件内容至索引
mv 移动或重命名一个文件、目录或符号链接
restore 恢复工作区文件
rm 从工作区和索引中删除文件
sparse-checkout 初始化及修改稀疏检出

检查历史和状态(参见:git help revisions)
bisect 通过二分查找定位引入 bug 的提交
diff 显示提交之间、提交和工作区之间等的差异
grep 输出和模式匹配的行
log 显示提交日志
show 显示各种类型的对象
status 显示工作区状态

扩展、标记和调校您的历史记录
branch 列出、创建或删除分支
commit 记录变更到仓库
merge 合并两个或更多开发历史
rebase 在另一个分支上重新应用提交
reset 重置当前 HEAD 到指定状态
switch 切换分支
tag 创建、列出、删除或校验一个 GPG 签名的标签对象

协同(参见:git help workflows)
fetch 从另外一个仓库下载对象和引用
pull 获取并整合另外的仓库或一个本地分支
push 更新远程引用和相关的对象

命令 'git help -a' 和 'git help -g' 显示可用的子命令和一些概念帮助。
查看 'git help <命令>' 或 'git help <概念>' 以获取给定子命令或概念的
帮助。
有关系统的概述,查看 'git help git'。 (for skill management), (for JSON parsing), and (for Python-based tools). Users currently need to build custom images or extend the base image.

🗣️ Type of Change

  • ✨ New feature (non-breaking change which adds functionality)

🤖 AI Code Generation

  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)

🔗 Related Issue

Fixes #1228

📚 Technical Context

  • Scope: docker/Dockerfile only
  • Impact: Increases image size slightly but greatly improves usability
  • Alpine packages: All tools from official Alpine repositories

🧪 Test Environment

  • Hardware: x86_64 VM
  • OS: Linux 4.19.112
  • Docker: Tested Dockerfile syntax

☑️ Checklist

  • My code follows the style of this project.
  • I have performed a self-review of my changes.
  • The change is minimal and focused on the specific issue.

@sipeed-bot sipeed-bot bot added type: enhancement New feature or request domain: docker labels Mar 10, 2026
Copy link
Copy Markdown

@nikolasdehor nikolasdehor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding development tools to the minimal Docker image is a significant change that contradicts PicoClaw's design philosophy of minimal resource usage.

Concerns:

  1. Image size impact -- python3 + py3-pip alone adds ~50-80MB to an Alpine image. Combined with git (~25MB) and bash (~5MB), this could more than double the final image size. For a project targeting embedded devices and minimal hardware (<10MB RAM), this is a substantial tradeoff that should be justified with concrete use cases.

  2. Security surface area -- python3 + pip introduce a large attack surface (pip can install arbitrary packages, python can execute arbitrary code). For a Docker image that runs an AI gateway, minimizing the attack surface is important.

  3. Alternative approach -- rather than bloating the minimal image, consider:

    • A separate Dockerfile.dev or a docker-compose.dev.yml that extends the minimal image
    • Multi-stage build with a --target=dev option
    • Document how users can extend the image: FROM picoclaw:latest\nRUN apk add --no-cache python3 git jq bash
  4. jq is already available via curl + pipe -- many API interactions can be handled without jq since the Go binary itself handles JSON.

  5. bash vs sh -- Alpine's default /bin/sh (busybox ash) handles most shell scripting needs. Adding bash as a dependency is rarely necessary.

I would recommend keeping the minimal image minimal and providing a separate dev/extended image variant instead.

darrenzeng2025 added a commit to darrenzeng2025/picoclaw that referenced this pull request Mar 11, 2026
…ash)

This addresses PR sipeed#1304 concerns by:
- Keeping the main Dockerfile minimal for production use
- Creating a separate Dockerfile.dev for development/debugging scenarios
- Adding docker-compose service with 'dev' profile for optional use

The development image includes tools for scripting, JSON processing,
and debugging while maintaining the minimal image for resource-constrained
deployments.
@darrenzeng2025
Copy link
Copy Markdown
Contributor Author

I've submitted a solution to address the concerns raised in this PR discussion.

Solution: Instead of modifying the minimal Dockerfile, I've created a separate development image approach:

  1. Created docker/Dockerfile.dev with the additional tools (jq, git, python3, pip, bash)
  2. Added picoclaw-gateway-dev service in docker-compose.yml with dev profile

This approach:

  • ✅ Keeps the main Dockerfile minimal for production use
  • ✅ Provides development tools for users who need them
  • ✅ Uses docker-compose profiles for easy selection
  • ✅ Maintains PicoClaw's design philosophy

The changes are in PR #1301 (same branch). Usage:

docker compose -f docker/docker-compose.yml --profile dev up picoclaw-gateway-dev

darrenzeng2025 added a commit to darrenzeng2025/picoclaw that referenced this pull request Mar 11, 2026
…ash)

This addresses PR sipeed#1304 concerns by:
- Keeping the main Dockerfile minimal for production use
- Creating a separate Dockerfile.dev for development/debugging scenarios
- Adding docker-compose service with 'dev' profile for optional use

The development image includes tools for scripting, JSON processing,
and debugging while maintaining the minimal image for resource-constrained
deployments.
Add commonly used development tools to the minimal Dockerfile:
- curl: HTTP requests and health checks
- jq: JSON processing
- git: Version control for skills
- python3 + py3-pip: Python script support
- bash: Better shell scripting support

These tools are essential for many PicoClaw skills and MCP tools
to function properly in containerized environments.

Fixes sipeed#1228
…ash)

This addresses PR sipeed#1304 concerns by:
- Keeping the main Dockerfile minimal for production use
- Creating a separate Dockerfile.dev for development/debugging scenarios
- Adding docker-compose service with 'dev' profile for optional use

The development image includes tools for scripting, JSON processing,
and debugging while maintaining the minimal image for resource-constrained
deployments.
@darrenzeng2025 darrenzeng2025 force-pushed the feat/docker-dev-tools branch from 19df15e to 984853f Compare March 11, 2026 01:36
darrenzeng2025 added a commit to darrenzeng2025/picoclaw that referenced this pull request Mar 11, 2026
…ash)

This addresses PR sipeed#1304 concerns by:
- Keeping the main Dockerfile minimal for production use
- Creating a separate Dockerfile.dev for development/debugging scenarios
- Adding docker-compose service with 'dev' profile for optional use

The development image includes tools for scripting, JSON processing,
and debugging while maintaining the minimal image for resource-constrained
deployments.
@sipeed-bot
Copy link
Copy Markdown

sipeed-bot bot commented Mar 26, 2026

@darrenzeng2025 Hi! This PR has had no activity for over 2 weeks, so I'm closing it for now to keep things tidy. If it's still relevant, feel free to reopen it anytime and we'll pick it back up.

@sipeed-bot sipeed-bot bot closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Pre-install essential dev tools (python, curl, jq, git, etc.) in Docker image

2 participants