# Container Registry (CRaaS)

AceCloud provides a managed container registry (Container Registry as a Service) for storing and managing Docker images, Helm charts, and OCI artifacts. Built on Harbor, it includes vulnerability scanning, access control, and multi-format support.

## Command Structure

```
ace registry status                              # Show registry status
ace registry create --name <name>                # Create a registry
ace registry delete <registry-name>              # Delete a registry
ace registry credentials                         # Generate login credentials
ace registry push-commands                       # Show push commands

ace registry repo list                           # List repositories
ace registry repo delete <repo-name>             # Delete a repository

ace registry artifact list <repo-name>           # List artifacts
ace registry artifact tags <repo> <digest>        # List artifact tags
ace registry artifact scan <repo> <digest>        # Start vulnerability scan
ace registry artifact delete <repo> <digest>      # Delete an artifact
ace registry artifact add-tag <repo> <digest> <tag>       # Add a tag
ace registry artifact remove-tag <repo> <digest> <tag>    # Remove a tag
ace registry artifact vulnerabilities <repo> <digest>     # Show CVE details
```

## Aliases

| Command                                 | Aliases                                                       |
| --------------------------------------- | ------------------------------------------------------------- |
| `ace registry`                          | `ace reg`, `ace craas`                                        |
| `ace registry status`                   | `ace registry info`, `ace registry list`, `ace registry ls`   |
| `ace registry credentials`              | `ace registry creds`, `ace registry login`                    |
| `ace registry push-commands`            | `ace registry push-cmds`, `ace registry push`                 |
| `ace registry repo`                     | `ace registry repos`, `ace registry repository`               |
| `ace registry artifact vulnerabilities` | `ace registry artifact vulns`, `ace registry artifact cve`    |
| `ace registry artifact remove-tag`      | `ace registry artifact rm-tag`, `ace registry artifact untag` |

***

## Registry Management

### Status

Show the current registry configuration for your project.

```bash
ace registry status
```

**Example output:**

```
REGISTRY NAME                  REGION               PROJECT ID                           CREATED
my-registry                    ap-south-noi-1       xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 2025-03-15
```

If no registry is configured:

```
No registry configured. Use 'ace registry create' to set one up.
```

### Create

Create a new container registry for your project.

```bash
ace registry create --name <registry-name> [--vulnerability-scanning]
```

| Flag                       | Description                                     |
| -------------------------- | ----------------------------------------------- |
| `--name`                   | Registry name (required, lowercase)             |
| `--vulnerability-scanning` | Enable automatic vulnerability scanning on push |

**Example:**

```bash
ace registry create --name my-registry
ace registry create --name my-registry --vulnerability-scanning
```

After creation, run `ace registry credentials` to generate login credentials.

### Delete

Delete a container registry.

```bash
ace registry delete <registry-name>
```

**Aliases:** `rm`

> **Warning:** This permanently deletes all repositories and artifacts in the registry.

### Credentials

Generate Docker login credentials for the registry.

```bash
ace registry credentials
```

**Aliases:** `creds`, `login`

**Example output:**

```
  Username:        robot$my-project+user
  Password:        ey...long-token...

  Use with: docker login <registry-url> -u robot$my-project+user -p ey...

  Warning: Save this password -- it cannot be retrieved later.
```

### Push Commands

Show ready-to-use push commands for Docker, Helm, and Podman.

```bash
ace registry push-commands
```

**Aliases:** `push-cmds`, `push`

**Example output:**

```
  Docker:
    login: docker login registry.acecloud.ai -u <username> -p <password>
    tag: docker tag <image> registry.acecloud.ai/<project>/<repo>:<tag>
    push: docker push registry.acecloud.ai/<project>/<repo>:<tag>

  Helm:
    login: helm registry login registry.acecloud.ai -u <username> -p <password>
    push: helm push <chart>.tgz oci://registry.acecloud.ai/<project>
```

***

## Repository Management

### List Repositories

```bash
ace registry repo list
```

**Aliases:** `ls`

**Example output:**

```
NAME                                     ARTIFACTS      PULLS        UPDATED
my-project/nginx                         3              15           2025-03-20
my-project/api-server                    7              42           2025-03-21
```

### Delete Repository

```bash
ace registry repo delete <repo-name>
```

**Aliases:** `rm`

***

## Artifact Management

### List Artifacts

List all artifacts (images) in a repository.

```bash
ace registry artifact list <repo-name>
```

**Example output:**

```
DIGEST               TAGS                           TYPE       SIZE       VULNS          PUSHED
sha256:abc123...     latest, v1.2.0                 IMAGE      45MB       12 (3 fix)     2025-03-20
sha256:def456...     v1.1.0                         IMAGE      44MB       8 (2 fix)      2025-03-18
```

### Get Tags

List all tags for a specific artifact by digest.

```bash
ace registry artifact tags <repo-name> <digest>
```

**Example output:**

```
TAG                            IMMUTABLE    URI
latest                         no           registry.acecloud.ai/my-project/nginx@sha256:abc...
v1.2.0                         no           registry.acecloud.ai/my-project/nginx@sha256:abc...
```

### Add Tag

```bash
ace registry artifact add-tag <repo-name> <digest> <tag-name>
```

### Remove Tag

```bash
ace registry artifact remove-tag <repo-name> <digest> <tag-name>
```

**Aliases:** `rm-tag`, `untag`

### Scan

Start or stop a vulnerability scan on an artifact.

```bash
# Start scan
ace registry artifact scan <repo-name> <digest>

# Stop scan
ace registry artifact scan <repo-name> <digest> --stop
```

### Vulnerabilities

Show detailed vulnerability (CVE) information for a scanned artifact.

```bash
ace registry artifact vulnerabilities <repo-name> <digest>
```

**Aliases:** `vulns`, `cve`

**Example output:**

```
CVE                  SEVERITY   PACKAGE                   CURRENT              FIXED IN
CVE-2024-1234        Critical   openssl                   3.0.12               3.0.13
CVE-2024-5678        High       curl                      8.4.0                8.5.0
CVE-2024-9012        Medium     zlib                      1.2.13               -
```

### Delete Artifact

```bash
ace registry artifact delete <repo-name> <digest>
```

**Aliases:** `rm`

***

## Global Flags

| Flag           | Description                                |
| -------------- | ------------------------------------------ |
| `-o, --output` | Output format: `table` (default) or `json` |
| `--project`    | Override project ID                        |
| `--region`     | Override region                            |

***

## Workflow Example

```bash
# 1. Create registry
ace registry create --name my-registry --vulnerability-scanning

# 2. Get credentials
ace registry credentials

# 3. Login to Docker
docker login registry.acecloud.ai -u <username> -p <password>

# 4. Tag and push image
docker tag myapp:latest registry.acecloud.ai/my-project/myapp:v1.0
docker push registry.acecloud.ai/my-project/myapp:v1.0

# 5. List artifacts
ace registry artifact list my-project/myapp

# 6. Scan for vulnerabilities
ace registry artifact scan my-project/myapp sha256:abc123

# 7. View results
ace registry artifact vulns my-project/myapp sha256:abc123
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.acecloud.ai/knowledge-base/cli/registry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
