150 Commits

Author SHA1 Message Date
Danny Canter 3fcf647c7b Add virtualization support for containers (#377) 0.3.0 2025-07-30 11:14:41 -07:00
Justin Yao Du 728527b8ba Explain how to install a release build in BUILDING.md (#379)
When users run commands with a debug build, they see a warning that
debug builds may have worse performance. Add instructions to BUILDING.md
so that users who wish to install from source know how to get a release
build.

I tested the command locally and ran `container --version` to verify
that I got a release build.
2025-07-29 19:11:06 -07:00
Kathryn Baldauf 047c1afe96 Fix user arg passthrough for container create (#393)
This matches other container commands that rely on user arguments at the
end, such as `container run`. Closes #395.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-29 13:54:12 -07:00
Danny Canter ccd15edc16 Bump Containerization to 0.5.0 (#363)
0.5.0 introduces a new way to configure the containers and execs. This
is now done all upfront at constructor time in a callback style. I'm
very happy with the config improvements, but because IO can only be
setup at constructor time this makes it so that we need to supply IO at
creation time of the VM or exec, which isn't the end of the world. All
that really changes is `boostrap()` and `createProcess()` now take in IO
instead of slightly later in `process.start()`
2025-07-29 16:02:19 -04:00
Sam Lord 837ef61397 Clarified documentation (#388)
The demonstration is that patch versions can be updated without breaking
changes, and that minor versions include breaking changes.

Please excuse the small documentation commit, just caused me a moment of
confusion.
2025-07-28 15:11:08 -07:00
Kathryn Baldauf 7dc1dda43f Update xcode developer version to new symlink (#374)
Related to https://github.com/apple/containerization/pull/234

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-25 13:11:29 -07:00
Sidhartha Mani cc4a85bb09 add support for local build output (#369)
Fixes https://github.com/apple/container/issues/354
2025-07-23 15:59:28 -07:00
J Logan f0eda65a20 Applies feedback for PR #352. (#365)
- Forgot to commit the changes to gracefully shut down the event loop
group used by the port forwards.
2025-07-23 12:10:59 -07:00
J Logan eea8cb6709 Adds --publish flag for forwarding traffic to container ports. (#352) 2025-07-23 00:28:41 -07:00
Danny Canter c0d1f8fb11 CLI: Handle stdin stream if it's a regular file (#322)
readabilityHandler is a bit crummy if it's a regular file. This just
writes our own loop and exits and shuts down the write end of the pipe
if we get to the end of the file.
2025-07-22 13:33:11 -07:00
Kathryn Baldauf 8002eec249 Add cause string to error message sent with xpc (#361)
Looks like we've been ignoring the "cause" field for
ContainerizationError when sent over xpc. Add the cause to the
`ContainerXPCError` message field instead of a new `cause` field since
`Error` is not encodable. The goal here is just to preserve information.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-21 15:04:28 -07:00
J Logan 0ef36d470b Use wildcard IP for UDP backend local address. (#359) 2025-07-19 00:15:53 -07:00
Steven Behnke 0327859adb Fix broken link to tutorial.md (#358)
The link to the `tutorial.md` file was referencing an invalid path. I
made it a relative path the tutorial markdown file.
2025-07-18 23:57:29 -07:00
Sidhartha Mani f68919c137 [Build] fixes for tar output mode (#353)
Fixes https://github.com/apple/container/issues/347
2025-07-18 16:50:11 -07:00
J Logan 1de3036f9a Adds TCP and UDP port forwarders. (#338) 2025-07-18 12:08:52 -07:00
J Logan 2e1bee1bda Fix subcommand groups in top level help. (#351)
- Closes #349.
2025-07-17 22:10:03 -07:00
Raj cc91ad7bf5 Quote paths in Makefile (#350)
Adds quotes around all variable‑derived paths in the Makefile to ensure
builds succeed when the project is located in directories that contain
spaces.
2025-07-17 17:17:13 -07:00
Typ0genius 8053e9f16b Make image details public (#335)
I want to access the different variants of an image in my app, which
information is only available in the ImageDetail. Although the function
ClientImage.details() -> ImageDetail and its return type are already
public, its properties aren’t, which prevents access to this
information.
2025-07-16 17:03:46 -07:00
Kathryn Baldauf b2e7cb5e87 Add test for using previous stages as FROM source (#342)
Depends on https://github.com/apple/container-builder-shim/pull/38 and a
new builder image tag
Related to https://github.com/apple/container/issues/334

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-16 14:35:29 -07:00
J Logan 1707e1b530 Use {install-root}/libexec/container-plugins for plugins. (#341)
- Use a directory that's separate from user data, as user-installed
plugins have a distinct lifecycle.
- Closes #340.
2025-07-15 18:18:38 -07:00
Di Warachet S. 78d4422a43 Docs: Add macOS 15 container-to-container communication limitation note to the tutorial (#328)
Add note about macOS 15 network isolation preventing
container-to-container communication

Ref: https://github.com/apple/container/issues/326
2025-07-15 16:15:52 -07:00
Dmitry Kovba f889c1bf76 Use the new @SendablePropertyUnchecked macro (#332)
Changes in this PR require merging
https://github.com/apple/containerization/pull/212 in containerization
and creating a new tag.
2025-07-14 16:57:55 -07:00
Dmitry Kovba c41a8883ea Use Mutex for thread-safe access to structs (#325)
Changes in this PR prevent a race caused by an implicit call to a
computed property getter when updating the property value.
2025-07-14 15:23:35 -07:00
Kathryn Baldauf f0d82d2032 Handle when keychain query returns an unhandled error (#331)
Depends on https://github.com/apple/containerization/pull/210
Related to https://github.com/apple/container/issues/254

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-14 14:52:12 -07:00
Typ0genius e09e932efa fix typo in local package path for building (#327) 2025-07-11 12:02:03 -07:00
J Logan 7272328cf3 Use swift package edit instead of CONTAINERIZATION_PATH. (#318)
- Closes #294.
2025-07-09 14:06:28 -07:00
Danny Canter 66a6974c6d ProcessIO: Don't error if stdin isn't a pty and !-i (#312)
We don't need to error unless we're supplying io.
2025-07-08 16:29:34 -07:00
J Logan f22674156c Flush output when following logs. (#316)
- Closes #315.
2025-07-08 16:01:22 -07:00
Arnav Reddy a7799d02e3 Mark SandboxSnapshot init as public for sandbox plugins (#309)
Changed `SandboxSnapshot` initializer from `package init()` to `public
init()` to enable external package consumers to create and use
`SandboxSnapshot` instances in their custom Sandbox plugins.

The `SandboxSnapshot` is used for `container list` functionality
2025-07-08 14:17:17 -07:00
J Logan 93076c9211 Updates SPI manifest to build on 6.2 only. (#297) 2025-07-07 13:37:13 -07:00
Kathryn Baldauf 20151d89e1 Fix build with local images test (#285)
Related to https://github.com/apple/container/issues/211

DO NOT MERGE until a new tag on container-builder-shim is created

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-07-01 18:22:57 -07:00
Sidhartha Mani 3c71bdc98d [Build] update builder shim to 0.3.0 (#288) 2025-07-01 16:39:56 -07:00
Aditya Ramani 5dd8f0f1c1 Cleanups for CI (#287)
Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-07-01 16:08:33 -07:00
Sidhartha Mani 6d804620a5 [Build] Disable rosetta during builds with a UserDefault (#273)
Fixes https://github.com/apple/container/issues/103
2025-07-01 14:52:41 -07:00
J Logan 75e92853e3 Assigns default nameserver in sandbox service. (#276)
* Closes #148.
* Storing the default nameserver in the bundle config means that DNS
won't work if the container stops and then restarts later when the
subnet address has changed.
2025-07-01 10:03:23 -07:00
Eliseo Martelli 48db62376d Use enum for ClientHealthCheck namespace (#225)
Switch `ClientHealthCheck` from a `struct` to an `enum` to prevent
instantiation.
2025-07-01 12:55:49 -04:00
Aditya Ramani 4bfa6c29ec Add unpack strategy to SnapshotStore (#274)
Define a `UnpackStrategy` function type in the `SnapshotStore` to give
more control over how an image is unpacked.

Previously, we were creating a 512 GB sparse block file for the initial
file system of a container, which is overkill.

With this change, the vminit image is unpacked to a smaller block file,
while container images are unpacked to the 512 GB block

Follows the same pattern as
https://github.com/apple/container/blob/main/Sources/Helpers/RuntimeLinux/RuntimeLinuxHelper.swift#L71

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-07-01 11:22:22 -04:00
Aditya Ramani 9a14630623 Docs for shell completion (#275)
Closes https://github.com/apple/container/issues/93

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2025-07-01 11:12:21 -04:00
J Logan 5450c9bc50 Adds next step link for building the project. (#278)
* Closes #277.
2025-06-30 20:41:21 -07:00
Dmitry Kovba 9eb2f860fc Use a consistent capitalization in a bug report template (#269) 2025-06-27 15:51:31 -07:00
J Logan 3b5c253059 Adds container network for macOS 26. (#243)
See discussion below for example. For multiple network interfaces in a
single container we'll want to integrate against a containerization that
includes apple/containerization#156.

The change bumps the containerization dependency to 0.2.0 and addresses
the breaking API changes.

```console
% container network
OVERVIEW: Manage container networks

USAGE: container network <subcommand>

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  create                  Create a new network
  delete, rm              Delete one or more networks
  list, ls                List networks
  inspect                 Display information about one or more networks

  See 'container help network <subcommand>' for detailed help.
```
0.2.0
2025-06-27 14:12:29 -07:00
Kathryn Baldauf 3fcd0dda67 Add version info to package installer (#249)
Fixes https://github.com/apple/container/issues/203

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-27 13:50:37 -07:00
Kathryn Baldauf 00aa883a83 Remove use of triage label (#262)
Tags on the repo should be a way to classify an item instead of denoting
workflow or status of the item. Remove the addition of the triage label
on bug and feature issues.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-27 14:07:53 -04:00
Eliseo Martelli b5589f7f8c Improve error handling in answerHost (#226)
Refactor `answerHost` to throw descriptive `DNSResolverError` instances
instead of returning nil when IP allocation or parsing fails.
2025-06-27 10:29:25 -07:00
Dmitry Kovba de2be705de Remove the support for CURRENT_SDK (#251)
This PR removes the no longer needed support for `CURRENT_SDK`.
2025-06-26 10:40:34 -04:00
Kathryn Baldauf e693139ab9 Move github issues to use feature and bug Types instead of Labels (#258)
Github now has a "Type" feature for issues. Types are set at the
organization level and can be used for consistent classification of
issues across an organization. We'd like to switch to using these to
classify if an issue is a bug or feature instead of labels. Labels will
be used for more granular classification within a repo.

See [github
docs](https://docs.github.com/en/issues/tracking-your-work-with-issues/configuring-issues/managing-issue-types-in-an-organization)
for more information about GitHub Issue Types.

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-25 16:40:21 -07:00
Sidhartha Mani c7c88c2e34 [Build] Do not use unbounded DispatchIO readers for tar tranfers (#257)
- Addresses https://github.com/apple/container/issues/166
- Memory utilization explodes since there is no mechanism for
backpressure
- Using a synchronous buffered reader seem to provide similar
performance without the memory explosion issue
- 4MB buffer seems to provide the best results

| Metric | 1MB Buffer | 4MB Buffer | Unbounded Zero-Copy |

|--------------------------|------------|------------|---------------------|
| Build Time | 149.33s | 138.57s | 139.79s |
| Max RAM Used | 2.16 GB | 3.02 GB | 3.52 GB |
| Peak Memory Footprint | 8.30 GB | 8.17 GB | 10.21 GB |
| Page Reclaims | 1,085,559 | 1,039,677 | 1,619,943 |
| Page Faults | 115 | 148 | 143 |
| CPU Usage (User+Sys) | 53.71s | 53.12s | 60.44s |
2025-06-25 13:51:51 -07:00
Kathryn Baldauf 4a6a1f15d8 Add test that we replace meta args in builder correctly (#255)
Depends on https://github.com/apple/container-builder-shim/pull/24 

Related to https://github.com/apple/container/issues/252

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-06-24 13:25:58 -07:00
Dmitry Kovba 5d36134b96 Regenerate documentation on make docs (#246)
This PR allows using `make docs` without manually removing the existing
`_site` folder.
2025-06-24 12:46:50 -07:00
Dmitry Kovba aa71809da6 Remove @unchecked Sendable (#250)
This PR removes `@unchecked Sendable` from the tests.
2025-06-24 10:45:21 -07:00