內建工具
目錄
Gordon 附帶了一個整合的工具箱,提供對各種系統工具和功能的訪問。這些工具擴充套件了 Gordon 的功能,使其能夠與 Docker Engine、Kubernetes、Docker Scout 的安全掃描以及其他開發者實用工具進行互動。本文件涵蓋了可用工具、它們的配置和使用模式。
配置
工具可以在工具箱中全域性配置,使其在 Gordon 的所有介面中都可訪問,包括 Docker Desktop 和 CLI。
配置方法
在 Docker Desktop 的詢問 Gordon 檢視中,選擇輸入區域左下角的
Toolbox
按鈕。選擇您想要啟用的工具。選擇卡片可以檢視有關每個工具及其功能的額外資訊。
有關可用工具的更多資訊,請參閱參考。
使用示例
本節提供了使用 Gordon 工具執行常見操作的面向任務的示例。
管理 Docker 容器
列出並監控容器
# List all running containers
$ docker ai "Show me all running containers"
# List containers using specific resources
$ docker ai "List all containers using more than 1GB of memory"
# View logs from a specific container
$ docker ai "Show me logs from my running api-container from the last hour"
管理容器生命週期
# Run a new container
$ docker ai "Run a nginx container with port 80 exposed to localhost"
# Stop a specific container
$ docker ai "Stop my database container"
# Clean up unused containers
$ docker ai "Remove all stopped containers"
使用 Docker 映象
# List available images
$ docker ai "Show me all my local Docker images"
# Pull a specific image
$ docker ai "Pull the latest Ubuntu image"
# Build an image from a Dockerfile
$ docker ai "Build an image from my current directory and tag it as myapp:latest"
# Clean up unused images
$ docker ai "Remove all my unused images"
管理 Docker 卷
# List volumes
$ docker ai "List all my Docker volumes"
# Create a new volume
$ docker ai "Create a new volume called postgres-data"
# Backup data from a container to a volume
$ docker ai "Create a backup of my postgres container data to a new volume"
Kubernetes 操作
# Create a deployment
$ docker ai "Create an nginx deployment and make sure it's exposed locally"
# List resources
$ docker ai "Show me all deployments in the default namespace"
# Get logs
$ docker ai "Show me logs from the auth-service pod"
安全分析
# Scan for CVEs
$ docker ai "Scan my application for security vulnerabilities"
# Get security recommendations
$ docker ai "Give me recommendations for improving the security of my nodejs-app image"
開發工作流程
# Analyze and commit changes
$ docker ai "Look at my local changes, create multiple commits with sensible commit messages"
# Review branch status
$ docker ai "Show me the status of my current branch compared to main"
參考
本節提供了您可以在 Gordon 工具箱中找到的內建工具的完整列表。
Docker 工具
與您的 Docker 容器、映象和卷互動的工具。
容器管理
名稱 | 描述 |
---|---|
list_containers | 列出所有 Docker 容器 |
remove_containers | 刪除一個或多個 Docker 容器 |
stop_container | 停止執行中的 Docker 容器 |
fetch_container_logs | 從 Docker 容器檢索日誌 |
run_container | 執行新的 Docker 容器 |
卷管理
工具 | 描述 |
---|---|
list_volumes | 列出所有 Docker 卷 |
remove_volume | 刪除 Docker 卷 |
create_volume | 建立新的 Docker 卷 |
映象管理
工具 | 描述 |
---|---|
list_images | 列出所有 Docker 映象 |
remove_images | 刪除 Docker 映象 |
pull_image | 從 Registry 拉取映象 |
push_image | 將映象推送到 Registry |
build_image | 構建 Docker 映象 |
tag_image | 標記 Docker 映象 |
inspect | 檢查 Docker 物件 |
Kubernetes 工具
與您的 Kubernetes 叢集互動的工具
Pods
工具 | 描述 |
---|---|
list_pods | 列出叢集中的所有 Pods |
get_pod_logs | 獲取特定 Pod 的日誌 |
Deployment 管理
工具 | 描述 |
---|---|
list_deployments | 列出所有 Deployments |
create_deployment | 建立新的 Deployment |
expose_deployment | 將 Deployment 作為 Service 暴露 |
remove_deployment | 刪除 Deployment |
Service 管理
工具 | 描述 |
---|---|
list_services | 列出所有 Services |
remove_service | 刪除 Service |
叢集資訊
工具 | 描述 |
---|---|
list_namespaces | 列出所有 Namespaces |
list_nodes | 列出叢集中的所有節點 |
Docker Scout 工具
由 Docker Scout 提供支援的安全分析工具。
工具 | 描述 |
---|---|
search_for_cves | 使用 Docker Scout CVEs 分析 Docker 映象、專案目錄或其他 Artifacts 以查詢漏洞。搜尋 cves |
get_security_recommendations | 使用 Docker Scout 分析 Docker 映象、專案目錄或其他 Artifacts,以獲取基礎映象更新建議。 |
開發者工具
通用開發實用工具。
工具 | 描述 |
---|---|
fetch | 從 URL 檢索內容 |
get_command_help | 獲取 CLI 命令的幫助 |
run_command | 執行 shell 命令 |
filesystem | 執行檔案系統操作 |
git | 執行 git 命令 |
AI 模型工具
工具 | 描述 |
---|---|
list_models | 列出所有可用的 AI 模型 |
pull_model | 下載 AI 模型 |
run_model | 使用 prompt 查詢模型 |
remove_model | 移除 AI 模型 |
AI 工具 Catalog
安裝了 AI 工具 Catalog Docker Desktop 擴充套件後,目錄中所有啟用的工具都可供 Gordon 使用。安裝後,您可以在 Gordon 的工具箱部分啟用 AI 工具 Catalog 的工具使用。