← 返回 Skills 市场
332
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install docker-cli
功能描述
Helper for using the Docker CLI to build, run, stop, inspect, and manage containers and images. Use when the user wants to perform container-related tasks fr...
使用说明 (SKILL.md)
\r \r
Docker CLI Helper\r
\r This skill explains how to use the Docker command line for common container workflows.\r \r
When to Use\r
\r Use this skill when:\r \r
- The user wants to build or rebuild a Docker image.\r
- The user wants to run a container (one-off or long-running).\r
- The user wants to see which containers/images/volumes exist.\r
- The user wants to stop or remove containers/images.\r
- The user wants to see logs, exec into a container, or check resource usage.\r \r
Requirements\r
\r
- Docker is installed and running.\r
docker versionordocker infoworks in the user’s shell.\r \r If unsure, suggest the user run:\r \r
docker version\r
```\r
\r
to confirm Docker is available.\r
\r
## Safety Guidelines\r
\r
- Prefer **read-only** or non-destructive commands first:\r
- `docker ps`, `docker ps -a`\r
- `docker images`\r
- `docker logs`\r
- `docker inspect`\r
- Be cautious with destructive commands:\r
- `docker rm`, `docker rmi`\r
- `docker system prune`\r
- `docker volume rm`\r
- Only recommend destructive cleanups when the user explicitly wants to free resources and understands what will be removed.\r
\r
## Common Workflows\r
\r
### 1. List and inspect containers\r
\r
List running containers:\r
\r
```bash\r
docker ps\r
```\r
\r
List all containers (including stopped):\r
\r
```bash\r
docker ps -a\r
```\r
\r
Inspect a container in detail:\r
\r
```bash\r
docker inspect \x3Ccontainer-id-or-name>\r
```\r
\r
### 2. List and inspect images\r
\r
List local images:\r
\r
```bash\r
docker images\r
```\r
\r
Inspect an image:\r
\r
```bash\r
docker inspect \x3Cimage-id-or-name>\r
```\r
\r
### 3. Build images\r
\r
Build an image from a `Dockerfile` in the current directory:\r
\r
```bash\r
docker build -t \x3Cimage-name>:\x3Ctag> .\r
```\r
\r
Example:\r
\r
```bash\r
docker build -t my-app:latest .\r
```\r
\r
If the `Dockerfile` is in another directory:\r
\r
```bash\r
docker build -t my-app:latest path/to/context\r
```\r
\r
### 4. Run containers\r
\r
Run a container in the foreground:\r
\r
```bash\r
docker run --rm -it \x3Cimage-name>:\x3Ctag>\r
```\r
\r
Run in detached mode (background service):\r
\r
```bash\r
docker run -d --name \x3Ccontainer-name> \x3Cimage-name>:\x3Ctag>\r
```\r
\r
Map ports from container to host:\r
\r
```bash\r
docker run -d --name \x3Ccontainer-name> -p 8080:80 \x3Cimage-name>:\x3Ctag>\r
```\r
\r
Mount a host directory into the container:\r
\r
```bash\r
docker run -d --name \x3Ccontainer-name> -v /host/path:/container/path \x3Cimage-name>:\x3Ctag>\r
```\r
\r
### 5. Stop and remove containers\r
\r
Stop a running container:\r
\r
```bash\r
docker stop \x3Ccontainer-id-or-name>\r
```\r
\r
Remove a stopped container:\r
\r
```bash\r
docker rm \x3Ccontainer-id-or-name>\r
```\r
\r
Stop and remove in one shot (two commands):\r
\r
```bash\r
docker stop \x3Ccontainer-id-or-name>\r
docker rm \x3Ccontainer-id-or-name>\r
```\r
\r
### 6. Remove images\r
\r
Remove an image by ID or name:\r
\r
```bash\r
docker rmi \x3Cimage-id-or-name>\r
```\r
\r
Only suggest this when the user is sure the image is no longer needed.\r
\r
### 7. Logs and exec\r
\r
See logs for a container:\r
\r
```bash\r
docker logs \x3Ccontainer-id-or-name>\r
```\r
\r
Stream logs (follow):\r
\r
```bash\r
docker logs -f \x3Ccontainer-id-or-name>\r
```\r
\r
Execute a shell inside a running container (if it has `/bin/bash`):\r
\r
```bash\r
docker exec -it \x3Ccontainer-id-or-name> /bin/bash\r
```\r
\r
or with `/bin/sh`:\r
\r
```bash\r
docker exec -it \x3Ccontainer-id-or-name> /bin/sh\r
```\r
\r
### 8. Clean up resources\r
\r
Only suggest these when the user explicitly wants cleanup:\r
\r
- Remove all stopped containers:\r
\r
```bash\r
docker container prune\r
```\r
\r
- Remove unused images:\r
\r
```bash\r
docker image prune\r
```\r
\r
- Remove everything unused (containers, networks, images, and optionally volumes):\r
\r
```bash\r
docker system prune\r
```\r
\r
For a more aggressive cleanup, but only if the user confirms:\r
\r
```bash\r
docker system prune -a\r
```\r
\r
## Troubleshooting Tips\r
\r
- If images cannot be pulled, check:\r
- Network connectivity.\r
- Registry authentication (if using a private registry).\r
- If ports are already in use, suggest:\r
- Changing the host port in `-p host:container`.\r
- Or stopping the process that currently uses the port.\r
- If a container keeps exiting immediately:\r
- Suggest checking `docker logs \x3Ccontainer>` for errors.\r
- Inspect entrypoint and command configuration.\r
\r
安全使用建议
This skill is coherent and simply documents Docker CLI commands. Before allowing an agent to execute any suggested commands, note: docker run -v (host mounts) and docker exec let processes access host files — only run those if you trust the agent and understand what host paths will be exposed. Be cautious with destructive commands (rmi, system prune) and confirm intent. No credentials or installs are required by the skill itself; it just assumes you have Docker available locally.
功能分析
Type: OpenClaw Skill
Name: docker-cli
Version: 1.0.0
The skill bundle provides standard documentation and command templates for managing Docker containers and images via the CLI. It includes appropriate safety guidelines regarding destructive operations (e.g., pruning or removing resources) and lacks any indicators of malicious behavior, data exfiltration, or prompt injection. All instructions in SKILL.md are aligned with the stated purpose of assisting with Docker workflows.
能力评估
Purpose & Capability
Name/description (Docker CLI helper) match the content: SKILL.md provides commands for building, running, inspecting, and cleaning up containers/images. No unrelated binaries, env vars, or config paths are requested.
Instruction Scope
Instructions stay within Docker CLI operations (build, run, logs, exec, prune). They do recommend high-privilege Docker actions such as mounting host directories (-v) and docker exec into containers — these are expected for a Docker helper but can expose host data if executed. The instructions do not ask the agent to read arbitrary host files or environment variables beyond using Docker commands.
Install Mechanism
No install spec and no code files — instruction-only skill. Nothing is downloaded or written to disk by the skill itself.
Credentials
The skill requests no environment variables, credentials, or config paths. That is proportional for a CLI helper that uses the local Docker daemon.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request permanent presence or modify other skills or system-wide settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install docker-cli - 安装完成后,直接呼叫该 Skill 的名称或使用
/docker-cli触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of docker-cli skill:
- Provides guidance for using the Docker CLI to build, run, stop, inspect, and manage containers and images.
- Includes common command examples for listing, inspecting, building, running, logging, and removing Docker containers and images.
- Outlines safety guidelines to prevent accidental data loss with clear distinctions between safe and destructive commands.
- Offers troubleshooting tips for common Docker issues.
- Suggests verifying Docker installation before use.
元数据
常见问题
Docker Cli 是什么?
Helper for using the Docker CLI to build, run, stop, inspect, and manage containers and images. Use when the user wants to perform container-related tasks fr... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 332 次。
如何安装 Docker Cli?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install docker-cli」即可一键安装,无需额外配置。
Docker Cli 是免费的吗?
是的,Docker Cli 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Docker Cli 支持哪些平台?
Docker Cli 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Docker Cli?
由 openlang(@openlang-cn)开发并维护,当前版本 v1.0.0。
推荐 Skills