> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 开发应用

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

1. [构建你的开发镜像](#build-your-development-image)
2. [重启所有 Docker 容器](#restart-all-containers)
3. [重新创建开发资源](#recreate-development-resources)

## 工作区设置

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

## 构建你的开发镜像

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

* 打开 `workspace/settings.py` 文件
* 更新 `image_repo` 为你的镜像仓库
* 设置 `build_images=True`

```python workspace/settings.py theme={null}
ws_settings = WorkspaceSettings(
    ...
    # -*- Image Settings
    # Repository for images
    image_repo="local",
    # Build images locally
    build_images=True,
)
```

### 构建新镜像

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

<CodeGroup>
  ```bash terminal theme={null}
  ag ws up --env dev --infra docker --type image
  ```

  ```bash short options theme={null}
  ag ws up -e dev -i docker -t image
  ```
</CodeGroup>

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

<CodeGroup>
  ```bash terminal theme={null}
  ag ws up --env dev --infra docker --type image --force
  ```

  ```bash short options theme={null}
  ag ws up -e dev -i docker -t image -f
  ```
</CodeGroup>

***

## 重启所有容器

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

<CodeGroup>
  ```bash terminal theme={null}
  ag ws restart --env dev --infra docker --type container
  ```

  ```bash short options theme={null}
  ag ws restart -e dev -c docker -t container
  ```
</CodeGroup>

***

## 重新创建开发资源

要重新创建所有开发资源，请使用 `--force` 标志：

<CodeGroup>
  ```bash terminal theme={null}
  ag ws up -f
  ```

  ```bash full options theme={null}
  ag ws up --env dev --infra docker --force
  ```

  ```bash shorthand theme={null}
  ag ws up dev:docker -f
  ```

  ```bash short options theme={null}
  ag ws up -e dev -i docker -f
  ```
</CodeGroup>
