> For the complete documentation index, see [llms.txt](https://asus-isg-aidc.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asus-isg-aidc.gitbook.io/guide/latest/cli/commandreference/container.md).

# Container Management

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/07/06    |

## Table of Contents

* [1. Overview](#overview)
* [2. Subcommands](#subcommands)
* [3. Usage Examples](#usage-examples)
* [4. Verifying Installation](#verifying-installation)
* [5. Related Commands](#related-commands)

***

## 1. Overview <a href="#overview" id="overview"></a>

{% hint style="warning" %}
**⚠️ Prerequisite: `aidc-cli init` required first**

This command depends on settings saved by [`aidc-cli init`](/guide/latest/cli/commandreference/init.md). Before running it, make sure you have completed:

* [`aidc-cli init inventory`](/guide/latest/cli/commandreference/init.md#inventory) — render the node inventory from `aidc.csv`
* SSH access to the nodes — [`aidc-cli deploy install`](/guide/latest/cli/commandreference/deploy.md) sets this up during OS deployment; for nodes that already have an OS, run [`aidc-cli deploy access-key`](/guide/latest/cli/commandreference/deploy.md) or fill the `password` column in `aidc.csv`
* [`aidc-cli init container-set` / `harbor-set`](/guide/latest/cli/commandreference/init.md#service-configuration) — save target groups and Harbor credentials

For the full setup sequence, see the [Getting Started](/guide/latest/cli/gettingstarted.md) guide.
{% endhint %}

The `container` command deploys and configures container runtimes and registries on target nodes, supporting Docker, Podman, and Harbor.

This module is the **execution layer**. In most cases, target groups or registry defaults should be configured first with `aidc-cli init container-set` or `aidc-cli init harbor-set`.

```bash
aidc-cli container <subcommand> [flags]
```

***

## 2. Subcommands <a href="#subcommands" id="subcommands"></a>

### 2.1 `docker` — Deploy Docker

Installs and configures Docker Engine on target nodes.

This command can run with direct CLI flags, but in the normal AIDC workflow the target group is prepared first with `aidc-cli init container-set`.

```bash
aidc-cli container docker -l <inventory-hostname> [-m <image>] [-n <count>]
```

| Flag              | Short | Required | Description                   |
| ----------------- | :---: | :------: | ----------------------------- |
| `--image`         |  `-m` |     ❌    | Docker image to pre-pull      |
| `--container_num` |  `-n` |     ❌    | Number of containers to start |

Target nodes with the global `--limit-hosts` / `-l` flag — see [Common Flags](/guide/latest/cli/commonflags.md).

***

### 2.2 `podman` — Deploy Podman

Installs and configures Podman on target nodes.

This command can run with direct CLI flags, but in the normal AIDC workflow the target group is prepared first with `aidc-cli init container-set`.

```bash
aidc-cli container podman -l <inventory-hostname> [-m <image>] [-n <count>]
```

| Flag              | Short | Required | Description                   |
| ----------------- | :---: | :------: | ----------------------------- |
| `--image`         |  `-m` |     ❌    | Container image to pre-pull   |
| `--container_num` |  `-n` |     ❌    | Number of containers to start |

Target nodes with the global `--limit-hosts` / `-l` flag — see [Common Flags](/guide/latest/cli/commonflags.md).

***

### 2.3 `harbor` — Deploy Harbor Registry

Deploys Harbor container registry on target nodes.

```bash
aidc-cli container harbor -l <inventory-hostname>
```

{% hint style="info" %}
Harbor has no subcommand-specific flags — target nodes with the global `--limit-hosts` / `-l` flag (see [Common Flags](/guide/latest/cli/commonflags.md)). Use `init harbor-set` to configure the Harbor admin password and target groups before deployment.
{% endhint %}

***

## 2.4 Preset vs Execution

| Phase     | Command                       | Purpose                                                           |
| --------- | ----------------------------- | ----------------------------------------------------------------- |
| Configure | `aidc-cli init container-set` | Save default target group for Docker or Podman deployment         |
| Configure | `aidc-cli init harbor-set`    | Save Harbor admin password and server/client groups               |
| Execute   | `aidc-cli container docker`   | Deploy Docker using the chosen targets and optional runtime flags |
| Execute   | `aidc-cli container podman`   | Deploy Podman using the chosen targets and optional runtime flags |
| Execute   | `aidc-cli container harbor`   | Deploy Harbor using saved Harbor defaults                         |

***

## 3. Usage Examples <a href="#usage-examples" id="usage-examples"></a>

```bash
# Configure container settings
aidc-cli init container-set

# Deploy Docker on a specific node
aidc-cli container docker -l 865235000209-1

# Deploy Docker with pre-pulled image and 2 containers
aidc-cli container docker -l 865235000209-1 -m alpine:latest -n 2

# Deploy Podman on a specific node
aidc-cli container podman -l 865235000209-1

# Deploy Podman with image and containers
aidc-cli container podman -l 865235000209-1 -m alpine:latest -n 2

# Deploy Harbor registry
aidc-cli container harbor -l 865235000209-1
```

***

## 4. Verifying Installation <a href="#verifying-installation" id="verifying-installation"></a>

```bash
# Verify Docker
docker --version
docker ps

# Verify Podman
podman --version
podman ps
```

***

## 5. Related Commands <a href="#related-commands" id="related-commands"></a>

| Command                  | Purpose                                  |
| ------------------------ | ---------------------------------------- |
| `init container-get/set` | View/set container runtime configuration |
| `init harbor-get/set`    | View/set Harbor registry admin password  |
