94 Commits

Author SHA1 Message Date
Saehej Kang 3b47905c0d [package]: bump containerization to 0.34.0 (#1774) 2026-06-20 18:24:30 -07:00
Michael Crosby c4a22389ac add container machine nested virt (#1742)
This also includes custom kernels for container machine. Its required
with nested virt as CONFIG_KVM needs to be enabled.

---------

Signed-off-by: michael_crosby <michael_crosby@apple.com>
2026-06-18 06:53:21 -07:00
Michael Crosby 7063196268 add standalone container machine document (#1674)
Signed-off-by: michael_crosby <michael_crosby@apple.com>
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
2026-06-09 13:09:39 -07:00
Raj b2994ac369 Add container machine for managing persistent Linux VMs (#1662)
## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
`container` runs each workload in an ephemeral VM, so there's no
built-in way to keep a persistent Linux environment you can log into and
work in. `container machine` adds one.

A container machine is a lightweight, persistent, and integrated Linux
environments that feel like an extension of your Mac, created from
standard OCI images with a familiar UX. The login user matches your host
account with passwordless `sudo`, your home directory is mounted inside
the VM, and each machine keeps its filesystem and runs the image's own
init system (such as`systemd` or `openrc`).

```bash
container machine create alpine:3.22 --name my-machine
container machine run -n my-machine # interactive shell
container machine set -n my-machine cpus=4 memory=8G
```

Subcommands: `create`, `run`, `list` (`ls`), `inspect`, `set`,
`set-default`, `logs`, `stop`, `delete` (`rm`); `m` aliases `machine`.
Docs added to `docs/command-reference.md` (Machine Management) and
`docs/how-to.md` ("Use container machines").

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs

Signed-off-by: Raj Aryan Singh <rajaryan_singh@apple.com>
Co-authored-by: Jaewon Hur <jaewon_hur@apple.com>
Co-authored-by: John Logan <john_logan@apple.com>
Co-authored-by: Michael Crosby <michael_crosby@apple.com>
Co-authored-by: Eric Ernst <eric_ernst@apple.com>
Co-authored-by: Danny Canter <danny_canter@apple.com>
2026-06-08 11:38:49 -07:00
J Logan 90cc3c15af Omit hash scheme from image.id. (#1658)
- Closes #1657.
- Also reduces `trimDigest()` output to 12 characters and gets rid of
the trailing ellipsis.
2026-06-05 14:43:20 -07:00
Raj 48cb23e3b7 Update command ref and how to docs (#1654)
- Closes #1534.
- Updates `command-reference.md` docs to reflect current
  state, and `how-to.md` to the latest images.
2026-06-05 08:36:52 -07:00
Kathryn Baldauf 25127fdb2a Fix type in memory size format for config docs (#1639)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-04 09:57:30 -07:00
Kathryn Baldauf 3512373541 Add docs on using container system configurations (#1636)
Closes https://github.com/apple/container/issues/1635. Provide tutorial
docs for users to customize default configuration settings.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2026-06-03 17:44:33 -07:00
J Logan 37595a734c Remove XPC compatibility code, simplify network model. (#1616)
- Refactor network model types: replace `NetworkState` enum and
phase-based NetworkStatus with a flat `NetworkStatus` struct.
- Simplify API server ↔ plugin protocol: plugin `status()` returns
runtime status only, API server owns configuration.
- `NetworksService` `list()`/`create()` now return `NetworkResource`
directly.
- Remove lifecycle phase checks and state machine guards throughout CLI
and API server.
- `variant` is plugin-specific, it's not a required property. This PR
replaces `NetworkPluginInfo` with a `plugin` name property on
`NetworkConfiguration` and an `options` list similar to that for
volumes.
- Moved `variant` to the option list.
2026-05-29 12:33:45 -07:00
Saehej Kang f4f5925c08 [how-to]: fix documentation example (#1596)
- Related to #1534
2026-05-28 15:45:41 -07:00
J Logan 985248cf23 Refine custom init how-to and BUILDING documentation. (#1586)
- Closes #1540.
- Use a published vminit image in the custom init example.
- Refine the integration test example in BUILDING.md to build in an
isolated app-root directory.

## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [x] Documentation update

## Motivation and Context
We don't make `latest` tags for vminit images, so the example would
fail.

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2026-05-22 09:01:00 -07:00
J Logan 3d291ff865 Add notes regarding --log-root to the command reference. (#1582)
- Closes #1529.
2026-05-21 17:19:44 -07:00
Simone Panico 9895ba8d08 Add container copy/cp command for host-container file transfer (#1190)
## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [x] Documentation update

## Motivation and Context
Adds the `container copy` (aliased as `cp`) command to copy files
between a running container and the local filesystem.

I saw [#1023](https://github.com/apple/container/pull/1023) and the
feedback from @dcantah — the previous attempt relied on tar being
installed inside the container.
This implementation takes the recommended approach:
file transfers go through the guest agent via the existing
`copyIn`/`copyOut` methods on the core `Containerization`, with no
dependency on container tooling.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs

---------

Co-authored-by: jwhur <57657645+JaewonHur@users.noreply.github.com>
2026-05-20 10:03:36 -07:00
J Logan 5b83b4a9ac Rename config file to config.toml. (#1568)
- Closes #1565.
- `runtime-config.toml` suggested the config
  pertains to just the runtime (managing container
  workloads) aspect of the system.
- Also renames `ADDR` columns to `IP` in 
  `container ls` and `container builder status`.
2026-05-16 08:23:21 -07:00
Noah Thornton e3c49803a0 Move to TOML configuration for defaults (#1425)
- Discussion topic #1336.
- This change migrates away from using `UserDefaults`,
  instead providing a TOML configuration mechanism for
  user configurable settings. All existing system property
  settings keys are supported in the new configuration
  file. However, users will have to migrate any settings
  they have configured in the `UserDefaults` into TOML
  for these settings to take effect.
- Breaking changes:
  * `container system property get` is removed in favor of
    users directly utilizing `container system property list --format toml | jq<>`.
  * `container system property set` is removed since the TOML
    configuration is effectively immutable during the lifetime of the
    `container` daemon. Uses can edit the TOML they have in their home
    directory, however no changes will take effect until the daemon is
    restarted via `container system stop && container system start`
* `container system property list --format table` is removed as
    generating tabular format is non-trivial and the new TOML format is
    intended to be human readable
2026-05-04 12:04:24 -07:00
J Logan 1ee2d9d054 Update documents with note about container-to-host networking. (#1482)
- Currently we need to use `pfctl` to create the packet filter rule for
container-to-host networking (`host.docker.internal`). This approach
unfortunately has a few limitations that require documentation.
2026-04-30 15:05:10 -07:00
ChengHao Yang 44754dacaf Add container system version with format yaml (#1353)
Fixed #1156. Introduces yaml formatting.

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-04-22 14:26:20 -07:00
J Logan 86611f588b Adds journal option to container volume create. (#1412)
- Closes #1411.
- Default behavior doesn't change today - with no `journal` option, no
journal gets created.
2026-04-22 09:34:24 -07:00
Nikunj Thakur 1c37384831 Add Color Progress Output Mode (#1384)
- Adds a color progress output mode (`--progress color`)
  that renders ANSI-colored progress output with visual
  differentiation between progress states.
- Like `ansi` mode, this feature requires a TTY.
- Closes #1366
2026-04-10 09:19:16 -07:00
Danny Canter a557ce80a5 Add capabilities support (#1383)
Closes #1352

Containerization has had support for a bit, it was just never brought
over here. It's exposed on the CLI via the classic `--cap-add` and
`--cap-drop` UX.
2026-04-07 17:09:56 -07:00
AJ Emory 3eec18214d Adding Bug Report Guide (#1292)
## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [x] Documentation update

## Motivation and Context
Adding help guide to bug report template to make it easier for users to
include relevant information

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2026-04-02 10:48:56 -07:00
Nikunj Thakur 745134540e Add Plain Progress Output Mode (#1367)
- Adds a `plain` progress output mode (`--progress plain`)
  that outputs newline-separated progress lines without
  ANSI escape sequences. This is useful for CI environments,
  piped output, and non-TTY contexts where ANSI cursor
  control is not supported. Unlike `--progress ansi`, plain
  mode works even when stderr is not a TTY.
- Closes #1365
- Related: #641, #808
2026-04-01 18:24:39 -07:00
Ryan Goulden a00ec5c1f7 Add support for build secrets (#1300)
docker-compatible `--secret id=key,...` arg for `container build`, that
works with Dockerfiles with `RUN --mount=type=secret`

Requires https://github.com/apple/container-builder-shim/pull/69

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Adds support for Dockerfiles that use build secrets (e.g. `RUN
--mount=type=secret ...`)

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2026-03-16 17:04:24 -07:00
ChengHao Yang 79ef8469bc Refactor: container export a tar archive (#1303)
Fixed #1265.

## Type of Change

- [ ] Bug fix
- [ ] New feature  
- [x] Breaking change
- [x] Documentation update

## Motivation and Context

Fixed #1265

## Testing

- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs

---------

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-03-11 12:43:13 -07:00
Danny Canter 899081d094 cli: Add --init to run/create (#1244)
Closes #1225

Add a flag to signify that we'd like to run a minimal init process that
can reap zombie processes. The actual support for this is in the
Containerization library so the plumbing here is very simple.
2026-02-23 16:02:38 -08:00
J Logan a409c0f7dd Add --format option for system status. (#1237)
- Closes #1236.
- As with other resources, default to tabular output, with `--format
json` alternative.
- Also changes common workflow to collect logs even when test step times
out.
2026-02-20 15:18:29 -08:00
J Logan d29947121f CI observability enhancements. (#1193)
- Adds a a `--log-root` option to `swift system start`, propagating the
value as `CONTAINER_LOG_ROOT` to services for logging to files instead
of the OS log facility. This is not a "production" capability as it
neither merges nor rotates logs.
- Currently we don't collect logs on CI builds, and we don't have
permission to run the `log` command there. The PR adds `--log-root` to
the CI test phase, archives the results, and uploads the archive as an
artifact.
- Use FilePath from swift-system for the log root. Foundation URL is a
bit of a footgun for filesystem paths, so unless we identify a
showstopper, we should incrementally transition to this type everywhere
except where we really need network URLs.
- Output the hostname of the CI runner at the start of the test phase so
we can identify runner-specific issues where they exist.
- Fix formatting for log messages with multiple metadata items, and fix
unstructured messages on instances that weren't found using `grep -r
'log\.' Sources`.
- Adds command reference documentation for `--log-root`.
2026-02-19 17:47:41 -08:00
ChengHao Yang c9f81ca332 Feat: add container registry list (#1119)
- Requires apple/containerization#502
- Closes #1088

---------

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-02-10 12:26:33 -08:00
Manu Schiller cf9b335aa1 feat: add --init-image flag for specifying custom init filesystem images per VM (#937)
- Users can now specify an alternate image to use
  with the `container run ---init-image` flag.
2026-02-09 18:11:27 -08:00
Amir Alperin 474906daf9 feat: Add runtime flag to container create and run commands (#1049) (#1109)
## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Fixes #1049 
-  Add --runtime option for Flags.Management
-  Apply runtime handler in containerConfigFromFlags
-  Update command-reference.md doc

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs

Co-authored-by: J Logan <john_logan@apple.com>
2026-02-06 13:38:19 -08:00
Saehej Kang 21dabb74fa [build-command]: Add --pull option for fetching latest image (#844)
- Closes #733.
2026-02-05 00:13:36 -08:00
Saehej Kang 3abf81f69e [image-list]: Add full size field to json output (#1098)
- Refer to #862
- Updated `SIZE` field to `FULL SIZE`, as it seemed more appropriate so
it does not get mixed up with the `descriptor size` field
- Closes #860
2026-01-27 20:00:43 -08:00
ChengHao Yang 24cbed56b3 Implement container prune (#904)
- Fixed #892.
- By contrast with `rm`, `prune` should display
  the amount of reclaimed storage, so added code
  to retrieve it.

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-01-27 14:55:49 -08:00
ChengHao Yang b371aee610 Feat: container image delete force option (#1096)
- Fixed #1087

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-01-26 13:07:05 -08:00
jwhur ed1185d489 Container-to-host networking. (#1078)
- Closes #346.
- This PR enables connecting host's localhost ports from
  containers.
- It adds an option `--localhost <localhost>` to DNS
  create command, after which the packets heading
  ip address in container are redirected to localhost in
  host machine. Packet filter rule is added and deleted
  along with the creation and deletion of localhost domain.
2026-01-23 17:59:28 -08:00
J Logan 744e7f7c7a Update for containerization 0.21.0. (#1056)
- Update image load and build to handle rejected paths during tar
extraction. For the image load command there is now a `--force` function
that fails extractions with rejected paths when false, and just warns
about the rejected paths when true.
- Update `container stats` for statistics API properties now all being
optional.

## Type of Change
- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [x] Documentation update

## Motivation and Context
See above

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2026-01-16 16:26:13 -08:00
J Logan 98410fdb57 Adds IPv6 port forwarding. (#1029)
- Closes #1006.
2026-01-07 18:23:31 -08:00
J Logan db8932ab0f Resolve IPv6 address queries for container names. (#1016)
- Closes #1005.
- Adapt everything to use MACAddress type from containerization 0.20.0.
- Allocate MAC addresses for every container so that we have
deterministic IPv6 link local addresses.
- Add AAAA handling to ContainerDNSHandler.
- NOTE: Only works on Tahoe. On Sequoia, we don't have a good way to set
or determine the IPv6 network prefix when networks are created, so we
can't infer the IPv6 link local addresses for AAAA responses and we
instead return `NODATA`.
2026-01-07 15:35:35 -08:00
c 4e78e30b20 Fix grammar in tutorial.md (#985)
## Summary
- Fixes a grammar error in the tutorial's publish section

## Details
Line 287 of `docs/tutorial.md` had "you need push images" which should
be "you need to push images".

This is a simple grammar fix to improve readability.

## Test plan
- [x] Verified the sentence now reads correctly
2026-01-01 17:57:47 -08:00
c 4958cf272f Fix bash completion source path in documentation (#981)
- Corrects the source path for bash completion script
  when not using bash-completion package.
2026-01-01 17:51:10 -08:00
c 25ac79a0c4 Fix MAC address option typo in how-to documentation (#980)
- Corrects the MAC address example command in the
  how-to guide to use the correct `--network` flag syntax
  instead of the incorrect `--mac-address` flag.
2026-01-01 17:50:19 -08:00
J Logan 5064b0ffd5 Adds network IPv6 configuration. (#975)
- Part of work for #460.
- Enable set/get of IPv6 network prefix in ReservedVmnetNetwork.
- Show IPv6 prefix in `network list` full output.
- Option for setting IPv6 prefix when creating a network.
- System property for default IPv6 prefix.

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [x] Documentation update

## Motivation and Context
See #460.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2025-12-22 10:16:14 -08:00
Saehej Kang 9f4efe0c4c [networks]: add prune command (#914)
- Closes #893
2025-12-17 00:30:33 -08:00
wangxiaolei a2901e0517 feat: implement version sub command (#911)
- closes #383
- implement version sub command, give more info

---------

Co-authored-by: fatelei <fatelei@fateleis-MacBook-Pro.local>
2025-12-09 23:04:40 -03:00
Saehej Kang a5fd902893 [docs]: move callout regarding documentation revisions (#921)
- Closes #920
- Makes note about main branch documentation more discoverable.
2025-12-02 10:12:42 -03:00
Saehej Kang f0eb13176c [docs]: add volume prune to command reference (#910)
## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [x] Documentation update

## Motivation and Context

Looks like this got accidentally deleted in #805

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2025-11-21 15:33:50 -08:00
Raj 1c0e9888f3 Fix container image prune to actually remove images, add -a flag support, and bump cz to 0.15.0 (#909)
- Fixes #901.

## Type of Change
- [x] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Previously `container image prune` called `ImageStore.prune()` (renamed
to `cleanupOrphanedBlobs()` in cz 0.15.0) which only removed orphaned
content blobs and never actually removed images.

This PR fixes that behavior so `container image prune` removes dangling
images by default, and with `-a` removes all unused images, not just
dangling ones.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-11-21 10:55:00 -08:00
Raj d327a50219 Add container system df command for disk usage reporting (#902)
- Closes #884. 

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
This PR implements the `container system df` command to display disk
usage statistics for images, containers, and volumes, along with their
total count, active count, size, and reclaimable space for each resource
type.

Active resources are determined by container mount references and
running state, while reclaimable space is calculated from inactive or
stopped resources.

Example output:
```
~/container ❯ container system df
TYPE           TOTAL  ACTIVE  SIZE      RECLAIMABLE
Images         4      3       4.42 GB   516.5 MB (11%)
Containers     4      2       2.69 GB   1.51 GB (56%)
Local Volumes  3      2       208.5 MB  66.2 MB (32%)
```

I'll have some follow-on PRs that will add `-v/--verbose` flag for
detailed per-resource information, `--filter` flag for filtering output
by resource type, and a `--debug` flag for debug statistics like block
usage, clone counts etc.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [ ] Added/updated docs
2025-11-20 09:19:00 -08:00
Danny Canter cf0eba495e Implement container stats (#851)
Closes #824

This implements statistics gathering across the various components, but
ultimately this is for implementing a new CLI command: `container
stats`. This shows memory usage, cpu usage, network and block i/o and
the number of processes in the container. The new command can inspect
stats for 1-N containers and by default continuously updates in a `top`
like stream.

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-11-18 14:10:05 -08:00
Danny Canter 14f1df59bf CLI: Implement exec -d (#852)
Surprised we didn't have this already..
2025-11-07 12:46:00 -08:00