# openclaw-docker **Repository Path**: hihuzi/openclaw-docker ## Basic Information - **Project Name**: openclaw-docker - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-04-07 - **Last Updated**: 2026-04-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenClaw Docker 镜像项目 一键制作 OpenClaw Docker/Podman 镜像,快速生成多个实例。 ## 项目结构 ``` openclaw-docker/ ├── Dockerfile # 镜像定义(Ubuntu + Node + OpenClaw + 插件) ├── build.sh # 构建脚本(修改顶部版本号即可升级) ├── create-instance.sh # 实例创建脚本(传参创建,自动分配端口) ├── entrypoint.sh # 容器入口脚本 └── README.md # 本文件 ``` ## 快速开始 ### 1. 构建镜像 ```bash cd openclaw-docker chmod +x build.sh create-instance.sh ./build.sh ``` ### 2. 创建实例 ```bash # 基本用法(自动分配端口) ./create-instance.sh mybot # 指定端口 ./create-instance.sh mybot 18790 # 指定端口和挂载路径 ./create-instance.sh mybot 18790 /data/instances ``` ### 3. 配置并启动 ```bash # 编辑配置 vim /home/hiecho/openclaw-instances/mybot/config/openclaw.json # 启动容器 podman run -d --name mybot \ -p 18790:18789 \ -v /home/hiecho/openclaw-instances/mybot/config:/root/.openclaw:Z \ -v /home/hiecho/openclaw-instances/mybot/workspace:/root/.openclaw/workspace:Z \ -e TZ=Asia/Shanghai \ openclaw:latest # 进入容器初始化 podman exec -it mybot openclaw setup ``` ## 升级 只需修改 `build.sh` 顶部的版本号,重新构建即可: ```bash # 编辑 build.sh,修改版本号 vim build.sh # 重新构建 ./build.sh # 重启所有实例(使用新镜像) podman stop $(podman ps -aq --filter ancestor=openclaw:latest) podman rm $(podman ps -aq --filter ancestor=openclaw:latest) # 重新创建实例(数据在挂载目录,不会丢失) ``` ## 国内源配置 所有源均使用国内镜像,无需翻墙: | 组件 | 源 | |------|------| | Ubuntu apt | 阿里云 mirrors.aliyun.com | | Node.js 二进制 | npmmirror.com | | npm 包 | registry.npmmirror.com | ## 默认端口分配 | 实例 | 宿主机端口 | 容器端口 | |------|-----------|---------| | mybot | 18789 | 18789 | | mybot2 | 18790 | 18789 | | mybot3 | 18791 | 18789 | | ... | 自动递增 | 18789 | ## 注意事项 1. 配置文件(openclaw.json、auth-profiles.json)通过 volume 挂载,不在镜像内 2. 镜像只预装软件,不包含任何配置和密钥 3. 每个实例有独立的数据目录,互不干扰 4. 容器内含 cron,可用于定时任务(偶尔丢失可接受) 5. 飞书插件随 OpenClaw 内置,微信插件预装到 extensions 目录