你的开发应用在本地 Docker 上运行,其资源定义在 workspace/dev_resources.py 文件中。本指南将展示如何:

  1. 构建你的开发镜像
  2. 重启所有 Docker 容器
  3. 重新创建开发资源

工作区设置

workspace/settings.py 文件中的 WorkspaceSettings 对象定义了你的工作区应用和资源使用的通用设置。

构建你的开发镜像

你的应用默认使用 agno 镜像。要使用你自己的镜像:

  • 打开 workspace/settings.py 文件
  • 更新 image_repo 为你的镜像仓库
  • 设置 build_images=True
workspace/settings.py
ws_settings = WorkspaceSettings(
    ...
    # -*- Image Settings
    # Repository for images
    image_repo="local",
    # Build images locally
    build_images=True,
)

构建新镜像

使用以下命令构建开发镜像:

ag ws up --env dev --infra docker --type image

要强制重新构建镜像,请使用 --force-f 标志

ag ws up --env dev --infra docker --type image --force

重启所有容器

使用以下命令重启所有 Docker 容器:

ag ws restart --env dev --infra docker --type container

重新创建开发资源

要重新创建所有开发资源,请使用 --force 标志:

ag ws up -f