Commit Graph

32 Commits

Author SHA1 Message Date
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
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 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
Raj 56f6d734f3 UX: fix typos, grammar and consistency issues (#845)
Fixes several typos, grammatical errors, and consistency issues to make
the UX smoother :)
2025-11-04 13:35:29 -08:00
Saehej Kang cd7c3a12c8 [options]: Replace --disable-progress-updates with --progress (none | ansi) (#808)
Part 1 of #641
2025-11-01 14:24:50 -07:00
Danish Singh Sethi c909cb3a27 Add --mac-address flag to set custom MAC addresses for containers (#753)
- Closes #752.
- Currently, there is no way to specify a custom MAC address for a
container's network interface and the MAC address is auto-generated by
the system.
- Use Cases
  - **Network Testing**: Developers testing network-dependent applications
that need predictable MAC addresses
  - **License Management**: Running containerized software with MAC-based
license keys
  - **Network Automation**: Scripts and tools that expect specific MAC
addresses for configuration
  - **Debugging**: Consistent MAC addresses across container restarts for
easier troubleshooting
2025-10-30 16:26:06 -07:00
Dmitry Kovba ea26cce50a Update documentation (#805)
Updates documentation according to the currently supported commands and
displayed help strings.
2025-10-29 09:04:24 -07:00
Danny Canter 9f8a0fb87d Build: Fallback to Containerfile if Dockerfile not found (#812)
Closes #782 #99

If a Dockerfile can't be found in the context dir, check for the common
alternative Containerfile. This does not implement .containerignore
also, solely Containerfile for now. This also funnily enough fixes us
not checking for the Dockerfile IN the context directory.. woops.

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

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-10-27 08:28:29 -07:00
Dmitry Kovba f2b3cbdd73 Lowercase stdin, stdout, stderr (#807)
Lowercased stdin, stdout, stderr.
2025-10-25 06:55:45 -07:00
Saehej Kang 671725c815 [command-reference]: Document what "auto" means in container run (#765)
## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [x] Documentation update

## Motivation and Context

Closes #746

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2025-10-22 13:49:54 -07:00
Raj b4c3ebfed8 add volume prune command (#783)
- Closes #508.

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

## Motivation and Context
Adds a `container volume prune` command that removes volumes with no
container references and reports the amount of disk space reclaimed.
This helps users clean up unused volumes and easily reclaim disk space.

Also updates the `volume delete` documentation to clarify and highlight
how the `--all` flag works.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-10-21 16:58:11 -07:00
Raj ce40ffd33d add support for multiple --tag flags in build (#785)
- Closes #732.

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

## Motivation and Context
Adds support for specifying multiple `-t` / `--tag` flags with the
`build` command. All specified tags will point to the same built image.

Example:
`container build -t myapp:latest -t myapp:v1.0.0 -t myapp:stable .`

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-10-21 13:03:46 -07:00
Raj 2f8de3a660 Implicitly create named volumes (#769)
- Closes #690.

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

## Motivation and Context
Named volumes are now implicitly created when referenced in container
commands. So, if `myvolume` doesn't exist and you run `container run -v
myvolume:/data alpine`, it is automatically created.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-10-16 14:48:57 -07:00
Raj f90f67ccf0 Add support for anonymous volumes (#768)
- Closes #726.

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

## Motivation and Context
Adds support for anonymous volumes. Users can now create volumes without
explicit naming using `-v /path` and `--mount type=volume,dst=/path`
syntax.

Usage:
```
# anonymous volume  
container run -v /data alpine
container run -v anon-01k7jpghe4kg4ph5a4vkccksbb:/data alpine

# Multiple anonymous volumes
container run --rm -v /logs -v /cache -v /tmp alpine
```

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-10-15 17:33:49 -07:00
siikamiika d8eb510e1e Support --subnet in network create (#737)
> [!CAUTION]
> Just noticed you can actually create a network that conflicts with an
existing network not managed by `network create`. Unless that is fine do
not merge!

Currently containerization only supports IPv4.

Example:
<img width="2012" height="578" alt="screenshot"
src="https://github.com/user-attachments/assets/38fef1ef-3ffd-4d77-b9e2-8c43f7e4851d"
/>



Docker ref: https://docs.docker.com/reference/cli/docker/network/create/
Podman ref:
https://docs.podman.io/en/v5.0.3/markdown/podman-network-create.1.html#subnet-subnet

Fixes apple/container#458

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

## Motivation and Context
[Why is this change needed?]

Scripted creation of deterministic network environments for containers

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2025-10-13 16:30:10 -07:00
J Logan f3b33ffc45 Cleans up option groups, container subcommand help. (#647)
- Part of #515.
- Add titles to option groups for container subcommands.
- Order option groups and container subcommand options alphabetically.
- Use `container-id` and `container-ids` consistently as argument names.
- Shorten long valueNames to avoid option column overflow in help output
where possible.
- Replace customShort and customLong with short, long, and shortAndLong
where possible.
- Always place global options and arguments after alphabetized
command-specific options.
- Rename RunCommand to ContainerRun and relocate it.
- Rename Executable to ContainerCLI.

## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [x] Breaking change (if you're depending on `RunCommand`, renamed).
- [ ] Documentation update

## Motivation and Context
See #385.

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-22 16:36:07 -07:00
J Logan 449f1d23df Replace scattered defaults subcommands with system property. (#604)
Common subcommands for all defaults.

- Closes #384.
- Replaces `registry default` and `system dns default` subcommands with
`system property`.
- Users can use `system property ls` to see details about each supported
default value.
- `system property set` implements reasonable validation for all
properties.
- NOTE: Probing of the registry for `registry default set` was removed,
which means users will find out about a botched setting when pulling or
pushing.
- Updates docs.

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

## Motivation and Context
See #384.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-09-16 13:37:55 -07:00
J Logan a54be363f7 Add --labels for networks. (#600)
- Closes #557.
- Breaking change: removes `.upToNextOption` for labels on volumes as
this is not what is done for containers, and it forces the argument to
precede the options if a label is supplied, which is non-intuitive.

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

## Motivation and Context
Consistent features and UX across managed resources.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-09-15 11:27:51 -07:00
Sidhartha Mani e42fe80aa0 Create command-reference.md (#445)
Fixes https://github.com/apple/container/issues/375
2025-08-29 10:23:45 -07:00