# List All Supported Commands for Apple Container: Complete CLI Reference

> Access the complete CLI reference for apple/container. Discover all supported commands for container lifecycle, image management, build operations, and machine virtualization.

- Repository: [Apple/container](https://github.com/apple/container)
- Tags: api-reference
- Published: 2026-07-06

---

**You can list all supported commands for apple/container by viewing the [`docs/command-reference.md`](https://github.com/apple/container/blob/main/docs/command-reference.md) file, which documents the complete CLI including container lifecycle, image management, build operations, and machine virtualization commands.**

The **apple/container** repository provides a native container runtime for macOS that leverages Apple Silicon virtualization. To list all supported commands for apple container, you need to understand the CLI structure implemented in Swift, which organizes functionality into logical groups spanning from basic container execution to virtual machine management.

## Where to Find the Authoritative Command Reference

The canonical documentation for every CLI command is maintained in **[`docs/command-reference.md`](https://github.com/apple/container/blob/main/docs/command-reference.md)** at the repository root. This file is auto-generated from source-level documentation comments using `swift-doc`, ensuring it stays synchronized with the implementation in [`Sources/CLI/ContainerCLI.swift`](https://github.com/apple/container/blob/main/Sources/CLI/ContainerCLI.swift). The reference contains exact flag syntax, examples, and usage notes for all subcommands.

## Core Container Execution Commands

The primary container lifecycle commands control creation, runtime, and termination of containers:

- **`container run`** — Launch a container from an image with options for resource allocation (`--cpus`, `--memory`), filesystem mounts (`--mount`), and port exposure (`--publish`).
- **`container create`** — Create a stopped container using the same flags as `run` without starting it.
- **`container start`**, **`container stop`**, **`container kill`**, **`container delete`**, **`container prune`** — Lifecycle management for running, stopping, force-killing, removing, and cleaning up containers.
- **`container exec`** — Run a new process inside an existing container.
- **`container logs`**, **`container stats`**, **`container inspect`** — View logs, live resource usage, or JSON metadata.

## Image Management Commands

Image operations handle OCI registry interactions and local storage:

- **`container image list`** — List local images.
- **`container image pull`** / **`container image push`** — Pull from or push to OCI registries with `--platform` support (e.g., `linux/arm64`).
- **`container image tag`** / **`container image delete`** / **`container image prune`** / **`container image inspect`** — Tag, delete, prune, or inspect images.
- **`container image save`** / **`container image load`** — Export or import images as tar archives.

## Build System Commands

The integrated BuildKit builder provides native image building:

- **`container build`** — Build an OCI image from a Dockerfile or Containerfile.
- **`container builder start`** / **`container builder stop`** / **`container builder status`** / **`container builder delete`** — Manage the BuildKit builder container lifecycle.

## Container Machine Management

Container machines are lightweight VMs that host the container runtime:

- **`container machine create`** / **`container machine run`** / **`container machine list`** / **`container machine delete`** — Create, execute commands in, list, and delete container machines.
- **`container machine set`** / **`container machine set-default`** / **`container machine logs`** / **`container machine stop`** — Adjust resources, set default machines, view logs, and stop machines.
- **`container m`** — Alias for `container machine`.

## Network and Volume Management

Persistent storage and networking capabilities include:

- **`container volume create`** / **`container volume delete`** / **`container volume list`** / **`container volume prune`** / **`container volume inspect`** — Manage persistent storage with options like `--opt journal=ordered`.
- **`container network create`** / **`container network delete`** / **`container network list`** / **`container network prune`** / **`container network inspect`** — Define user-defined container networks (requires macOS 26+).

## System Services and Utilities

System-level commands control the daemon and utilities:

- **`container system start`** / **`container system stop`** / **`container system status`** / **`container system version`** / **`container system logs`** / **`container system df`** — Control the container daemon, view status, logs, disk usage, and version.
- **`container system dns create`** / **`container system dns delete`** / **`container system dns list`** — Create local DNS domains for containers.
- **`container system kernel set`** — Install a custom Linux kernel.
- **`container registry login`** / **`container registry logout`** / **`container registry list`** — Store and manage OCI registry credentials.

## CLI Architecture and Source Files

The command structure is implemented in specific Swift source files:

- **[`Sources/CLI/ContainerCLI.swift`](https://github.com/apple/container/blob/main/Sources/CLI/ContainerCLI.swift)** — Implements the top-level CLI parsing and dispatches to subcommands implemented as Swift structs.
- **[`Sources/ContainerPersistence/ContainerSystemConfig.swift`](https://github.com/apple/container/blob/main/Sources/ContainerPersistence/ContainerSystemConfig.swift)** — Holds the `ContainerConfig` struct used by resource-related flags (`--cpus`, `--memory`, `--runtime`).
- **[`Package.swift`](https://github.com/apple/container/blob/main/Package.swift)** — Defines the Swift package, dependencies (including the `Containerization` package), and builds the `container` executable.

## Practical Usage Examples

Below are runnable examples demonstrating frequently used commands:

```bash

# Run an interactive shell in Ubuntu

container run -it ubuntu:latest /bin/bash

# Start a detached web server with port mapping

container run -d --name web -p 8080:80 nginx:latest

# Build a multi-tag image

container build -t myapp:latest -t myapp:1.0 .

# List all containers including stopped ones

container list --all --format json

# Pull specific platform image with plain progress

container image pull --platform linux/arm64 --progress plain alpine:latest

# Create a named volume with ordered journaling

container volume create --opt journal=ordered mydata

# Create a custom container network

container network create --subnet 192.168.100.0/24 mynet

# Start system services with kernel installation

sudo container system start --enable-kernel-install

# Inspect container metadata

container inspect mycontainer-id

# Run command inside default machine

container machine run uname -a

```

## Summary

- The authoritative list of apple container supported commands lives in **[`docs/command-reference.md`](https://github.com/apple/container/blob/main/docs/command-reference.md)**, auto-generated from Swift source comments.
- Commands are organized into groups: **core execution**, **image management**, **build system**, **machine management**, **network/volume**, and **system services**.
- Resource flags like `--cpus` and `--memory` map to the `ContainerConfig` struct in [`Sources/ContainerPersistence/ContainerSystemConfig.swift`](https://github.com/apple/container/blob/main/Sources/ContainerPersistence/ContainerSystemConfig.swift).
- The CLI entry point in **[`Sources/CLI/ContainerCLI.swift`](https://github.com/apple/container/blob/main/Sources/CLI/ContainerCLI.swift)** parses the top-level `container` command and dispatches to subcommands.
- **macOS 26+** is required for network management commands, while machine management requires `sudo` for some system operations.

## Frequently Asked Questions

### How do I view the complete list of apple container commands offline?

Clone the repository and open [`docs/command-reference.md`](https://github.com/apple/container/blob/main/docs/command-reference.md), which contains the complete reference including all flags and examples. This file is kept in sync with the source code through `swift-doc` generation, ensuring it reflects the exact implementation in [`Sources/CLI/ContainerCLI.swift`](https://github.com/apple/container/blob/main/Sources/CLI/ContainerCLI.swift).

### What is the difference between `container machine` and `container run`?

`container run` executes containers inside a container machine (a lightweight VM), while `container machine` commands manage the VMs themselves. You use `container machine create` to provision the virtualization layer, then `container run` to launch workloads inside it. The `container m` alias provides shortcut access to machine commands.

### Where are the command-line flags defined in the source code?

Command-line flags like `--cpus`, `--memory`, and `--mount` are parsed in **[`Sources/CLI/ContainerCLI.swift`](https://github.com/apple/container/blob/main/Sources/CLI/ContainerCLI.swift)** and translated into the `ContainerConfig` struct defined in **[`Sources/ContainerPersistence/ContainerSystemConfig.swift`](https://github.com/apple/container/blob/main/Sources/ContainerPersistence/ContainerSystemConfig.swift)**. The Swift structs use property wrappers to define the CLI interface, which `swift-doc` reads to generate the reference documentation.

### How do I get help for a specific subcommand?

Use the built-in help system by running `container help <command>` or appending `--help` to any command. For example, `container run --help` displays available flags for resource limits and port mappings, while `container help image` shows all image-related subcommands.