Commit Graph

156 Commits

Author SHA1 Message Date
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
Saehej Kang d610a85703 [container-run-create]: add support for --network none (#739)
Closes #386
2025-10-21 11:18:06 -07:00
Saehej Kang 27eee1e7f9 [container-system-dns-ls]: add --format and --quiet options (#720)
Closes #510
2025-10-16 16:18:52 -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
J Logan 78701f1b73 Add app bundle Info.plist as a system property source. (#764)
- Closes #708.
- Allows `container` and services/plugins to get backstop defaults from
  `Info.plist` properties if repackaged into a signed app bundle.
2025-10-14 17:00:03 -07:00
Kathryn Baldauf 6cb40b3687 Add image env variables to builder start command (#756)
## Type of Change
- [x] Bug fix

## Motivation and Context
Required for builder to run correctly with bug fix in containerization
here https://github.com/apple/containerization/pull/329. Builder was
previously not passing any environment variables when starting the
initial process.

## Testing
- [x] Tested locally

---------

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-10-14 11:13:18 -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 77e68a7613 Moves .build directory to builder. (#749)
Closes #416.

## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [x] Breaking change (possibly, I would think we're just going to leave
an unused `.build` directory behind which we can document, but can run
more tests next week).
- [ ] Documentation update

## Motivation and Context
We have nothing to hide?

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-10-10 10:19:05 -07:00
J Logan bc70b39182 Fix broken proxy configuration for default kernel fetch. (#747)
- Closes #466.

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

## Motivation and Context
Proxy logic worked well enough for CI but broken in general.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [ ] Added/updated docs
2025-10-10 10:17:42 -07:00
Bisman Sahni 0d3f20c4ca Fix race condition in ContainersService.create() (#721)
Fixes #692 

This PR resolves a race condition in `ContainersService.create()` that
occurs when creating containers with the same name concurrently.
2025-10-08 17:30:06 -07:00
Kathryn Baldauf 23b058c53c Remove StandardErrorPath and StandardOutPath from launchd plists (#742)
## Type of Change
- [x] Bug fix

## Motivation and Context
We setup logging for the services in `container` using OSLog. See
[here](https://github.com/apple/container/blob/73709232d2705b7008b7380fe90a373059b6074a/Sources/Helpers/APIServer/APIServer.swift#L31).
This makes it unnecessary to redirect stderr and stdio for these
services. Additionally, there are some cases where failure to open or
write to the path given for StandardErrorPath or StandardOutPath in a
service's plist could result in a failure to start a service through
`launchctl`.

Related to https://github.com/apple/container/discussions/713

## Testing
- [x] Tested locally

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-10-08 16:08:08 -07:00
Danny Canter 73709232d2 CLI: Fix env-file parsing (#707)
Closes #691

Any envvars that had equal signs in the value would be ommitted today.
This change brings it much more in line with docker's behavior/parser
and adds unit tests to verify this is the case.
2025-10-06 12:12:50 -07:00
J Logan bfc5ca9222 Removes "all rights reserved" from license header. (#711)
Closes #63.
2025-10-03 13:28:16 -07:00
Dmitry Kovba 48230f3804 Update license headers in C files (#693)
## Type of Change
- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
There was a duplicated and outdated license header in some files.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-10-02 09:42:24 -07:00
J Logan ffc1195556 Remove references to macOS 26 beta. (#702)
## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [x] Documentation update
2025-10-01 15:27:35 -07:00
J Logan d045e5b0f0 Updates containerization to 0.9.1. (#697)
- Converts client to work with ExitStatus instead of integer error
codes.

## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [x] Breaking change (SandboxClient.wait() returns ExitStatus instead
of Int32, apple/containerization#300)
- [ ] Documentation update

## Motivation and Context
Pick up DNS bug fix, update for breaking API change.

## Testing
- [x] Tested locally
- [x] Added/updated tests (fixed DNS test, using correct `options` now,
apple/containerization#303).
- [ ] Added/updated docs
2025-10-01 10:04:39 -07:00
Dmitry Kovba 69fd9484b9 Fix races in the SandboxService actor due to reentrancy after await calls (#684)
This PR fixes several races with the `stop()` and `shutdown()` methods
by moving all state transitions inside a lock.

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

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

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-25 18:35:51 -04:00
J Logan 2b07e890c7 Relocate ProcessIO to ContainerClient. (#681)
- Makes ProcessIO more generally available.
- `Application.handleProcess(processIO:process:)` becomes
`processIO.handleProcess(process:log:)`.

## Motivation and Context
This code shouldn't be in the CLI, it should be part of ContainerClient.
2025-09-24 18:02:34 -07:00
J Logan 0fe44a04fb Adds a plain stderr log handler. (#680)
- Initial work for #642. CLI commands will configure this log handler so
that they write warnings and errors to stderr, and only proper output
will go to stdout.
- Facilitates #507. The `--debug` option can set the logging level
appropriately, and CLI commands can just use `log.debug()`.

## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update
2025-09-24 13:57:34 -07:00
J Logan e54ee7cb4e Fix regression - removed shutdown XPC inadvertently. (#675)
## Motivation and Context
#654 forgot to include the shutdown XPC that was added in #628.
2025-09-23 14:50:14 -07:00
J Logan e7018bc30b Cleans up image subcommand options. (#659)
- Part of #515.
- Order options alphabetically.
- Use consistent descriptions for platform, os, arch.
- Add os/arch options to push.
- Rename ImageRemove to ImageDelete since delete is the primary command
and rm is the alias.

## Motivation and Context
Clear, consistent presentation of command help.
2025-09-23 10:55:04 -07:00
J Logan 076d28ebb1 Add and use container-runtime-linux start. (#654)
- Part of #653.
- No need for `defaultCommand` since ContainerService startup will write
a new launchd plist with the `start` subcommand included.

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

## Motivation and Context
Allows us to add commands to support post-installation, migration, etc.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-23 10:05:06 -07:00
J Logan e460ca9252 Add and use container-apiserver start. (#655)
- Part of #653.
- Also use same file organization for network helper.

## Motivation and Context
Future-proof plugin CLIs.
2025-09-23 10:01:02 -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
Danny Canter 7df9763aa5 ClientContainer: Remove response timeout from stop (#667)
After the large reworks, I'm not as worried about having this timeout
anymore. Prior to the reworks stop was signaled via an async event sent
to the daemon as stop was performed directly on the given runtime-helper
instance. If anything errored during that it was common for things to
explode, but now that stop is:

client -> APIServer -> runtime-helper instance

and the logic for stop has been improved quite a bit, in addition to
stop no longer holding a lock during it's operation, I'm not sure we
need this. In the future it'd also be nice to support no timeout (the
timeout until we send SIGKILL, not response timeout) in which case we'd
have to have an extra bit of logic here to skip the response timeout in
that scenario anyways.
2025-09-22 14:17:38 -07:00
J Logan bcfcd5ac19 Cleans up registry subcommand options. (#660)
- Part of #515.
- Order options alphabetically.

## Motivation and Context
See #515.
2025-09-22 13:18:20 -07:00
J Logan 1f94a8340a Cleans up build subcommand options. (#658)
- Part of #515.
- Order options alphabetically.
- Use `container ls` options for `builder status`.

## Type of Change
- [ ] Bug fix
- [ ] New feature  
- [x] Breaking change - Change options and output of `builder status`.
- [x] Documentation update

## Motivation and Context
See #515.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [x] Added/updated docs
2025-09-22 12:48:45 -07:00
J Logan 7d905bde64 Cleans up network and volume subcommands. (#661)
- Part of #515.
- Order options alphabetically.
- Use consistent delete logic for network and volume delete.

## Motivation and Context
See #515
2025-09-22 12:17:24 -07:00
J Logan f86befafc7 Cleans up system subcommand options. (#662)
- Part of #515.
- Order options alphabetically.
- Make descriptions more concise and consistent.

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

## Motivation and Context
See #515.

## Testing
- [ ] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-22 11:05:48 -07:00
J Logan 06eab455c8 Clarify memory units in help and documentation. (#657)
Closes #519.

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

## Motivation and Context
Clarifies memory units.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-09-22 11:05:06 -07:00
Dmitry Kovba 6eaf51b8bc Remove Native Builder from the main branch (#634)
The work on the Native Builder has been moved to a separate branch
`dev/native-builder`. This PR removes it from the `main` branch.
2025-09-20 00:07:57 -07:00
Danny Canter 444064dc35 Swap to APIServer for all communications (#628) 2025-09-19 23:09:01 -07:00
J Logan 07f1d60a52 Use com.apple.container.registry as keychain ID. (#652)
- Closes #644.

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

## Motivation and Context
Avoids conflicts.

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-19 09:41:55 -07:00
Danny Canter 2ef1d8fdbb CLI: Skip stopping containers in system stop if APIServer is down (#650)
Today if you do system stop twice (or if you forgot the server isn't
running) you get bombarded with annoying (and confusing) XPC interrupted
messages. We should skip the container stop and list dance if we can't
talk to the APIServer with a simple ping.
2025-09-19 08:56:23 -07:00
Morris Richman 996a6819e3 Rename CLI and ExecutableCLI folders (#635)
## Motivation and Context
This is an extension of #603 to cleanup the folder structure and have it
match with the new library and target names.
2025-09-18 17:49:48 -07:00
Morris Richman dd6bdc20cf Expose Command Structs for Plugins (#603)
## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Plugins technically exist, but to add shortcuts or to do existing things
with functions in `container` requires calling a compiled binary. This
pull request aims to remove that hurdle and instability by exposing
commands as a new `ContainerCommands ` target.

Simply import `ContainerCommands` and you can access almost
any command as if it were a native part of the binary. This makes
plugin development significantly easier.

Closes #609.
2025-09-17 15:24:26 -07:00
Dmitry Kovba c571546f60 Use a lock consistently in the ExecutionContext class (#619)
The changes in this PR improve the consistency of using a lock in the
`ExecutionContext` class.
2025-09-17 09:49:30 -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
Kathryn Baldauf 386fd87b5d Enumerate using relative paths to avoid mismatch with symlink resolution of special paths like /tmp (#613)
## Type of Change
- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Motivation and Context
Fixes https://github.com/apple/container/issues/588. This PR changes the
archiver compression file enumeration to use the
[enumerator(atPath:)](https://developer.apple.com/documentation/foundation/filemanager/enumerator(atpath:))
version. This version returns relative paths instead of full file paths
from the filesystem. /tmp is symlinked to /private/tmp and some swift
packages will handle that path differently. While a call to Foundation's
`URL.resolvingSymlinksInPath()` will return "/tmp", a call to
`FileManager.enumerator(at:)` will return "/private/tmp". This
difference causes a container image build to fail when the user is using
a path under /tmp or other special case paths as the context directory.

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

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-09-16 10:52:08 -07:00
J Logan 79cc363e78 Relocates API server to Helpers, service to Services. (#616)
- Closes #615.

Improves project organization. Separates service so it can be tested and
used separately from the executable target. No functional changes.
2025-09-16 10:14:14 -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
J Logan 58e0ddd948 Revert inadvertent pull platform filtering from #545. (#593)
- Reverts an inadvertent "fix" from #545.
- Closes #592.

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

## Motivation and Context
See #592 

## Testing
- [x] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-10 10:22:55 -07:00
J Logan 6da5ecf838 Remove images alias for image subcommand. (#597)
- Closes #596.

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

## Motivation and Context
- Part of UX audit #385.
- All other resource subcommands are singular and have no plural alias.
- `container image` corresponds to `docker image`; `container images`
does not.

## Testing
- [x] Tested locally
- [x] Added/updated tests
- [x] Added/updated docs
2025-09-10 10:06:48 -07:00
J Logan 98402bf4e6 Adds multiple image save to tarfile. (#560)
## Type of Change
- [ ] Bug fix
- [x] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Description

```bash
% container image save -o container.tar python:alpine alpine:latest
Warning! Running debug build. Performance may be degraded.
Image(s) saved        

% tar tf container.tar 
oci-layout
blobs/
blobs/sha256/
blobs/sha256/02f8efbefad605a169e89926147edd0676646263268f303c6fb3cdfdbc4a9612
blobs/sha256/a4bb08daca6b0385b17761b170fc91b20ab2ec072f70f9260149f8d61846ac13
blobs/sha256/588270f913bc82b4dbeee27bc249e4d314894becd18cccdc13645f669972c91e
blobs/sha256/692b7bac6678f5809640189eb1d95a3277689ec643201c465ecd44e72db7d029
blobs/sha256/1d24a57b1de9b287d9a9e1e231b71a235b836dc1852155b943b927a411d8c394
blobs/sha256/f9841e55dcbf5a6fcc702b25ce6e411ebdcb30680f94afd8060cb20bb20bd75c
blobs/sha256/0b83d017db6efafadf6b3f18d087d2ce1d67d8f0e927dc7254b0ad088074cd3a
blobs/sha256/b2236d9e1563c507613962c1ebbd7b3d307969ec2ee355b781b68440f4f0bee3
blobs/sha256/6e174226ea690ced550e5641249a412cdbefd2d09871f3e64ab52137a54ba606
blobs/sha256/c879780ac011609647c8714eef9e6490c42bf20128b32f4b31c4daad1242647b
blobs/sha256/26a1da51444d4cbbba3233caa342d0397ac4f93dc8e305e31989fd782b3107da
index.json

% tar -xOf container.tar index.json | python3 -m json.tool
{
    "schemaVersion": 2,
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.index.v1+json",
            "annotations": {
                "org.opencontainers.image.ref.name": "docker.io/library/python:alpine",
                "io.containerd.image.name": "docker.io/library/python:alpine",
                "com.apple.containerization.image.name": "docker.io/library/python:alpine"
            },
            "size": 944,
            "digest": "sha256:1d24a57b1de9b287d9a9e1e231b71a235b836dc1852155b943b927a411d8c394"
        },
        {
            "mediaType": "application/vnd.oci.image.index.v1+json",
            "annotations": {
                "io.containerd.image.name": "docker.io/library/alpine:latest",
                "org.opencontainers.image.ref.name": "docker.io/library/alpine:latest",
                "com.apple.containerization.image.name": "docker.io/library/alpine:latest"
            },
            "size": 497,
            "digest": "sha256:692b7bac6678f5809640189eb1d95a3277689ec643201c465ecd44e72db7d029"
        }
    ]
}
```

## Motivation and Context
`image load` can read multiple images from a tar file, but `image save`
cannot save multiple images today.

## Testing
- [x] Tested locally
- [ ] Added/updated tests (TODO: roundtrip test pull-save-rm-load)
- [ ] Added/updated docs (TODO: check command reference)
2025-09-09 16:46:18 -07:00
mazdak be89df833b Make "Plugin not found" message more descriptive (#569)
Users frequently saw “failed to find plugin …” when the system services
weren’t running; the message didn’t explain the root cause or where
plugins are looked up. No change to plugin execution flow; only error
messaging and path discovery hints are improved for a better UX.
2025-09-08 16:13:23 -07:00
mazdak bd2c228b57 DefaultCommand signal behavior improvements for plugins (#570)
## Type of Change
- [x] Bug fix
- [ ] New feature  
- [ ] Breaking change
- [ ] Documentation update

## Description
Correct signal semantics for plugins: Container binary currently execs
into plugin binaries. If the parent CLI keeps SIGINT/SIGTERM handlers
installed, it can intercept/alter signal behavior intended for the
plugin (e.g., preventing graceful shutdown in foreground workflows).

## Motivation and Context
During the development of a plugin (docker compose compatibility
plugin), I encountered a major issues where CTRL-C (SIGTERM) was not
being sent to my plugin. CLI plugins, especially those that have long
running tasks need a way to handle signals from the OS. Current, we exec
into plugin binaries. If the parent CLI keeps SIGINT/SIGTERM handlers
installed, it can intercept/alter signal behavior intended for the
plugin (e.g., preventing graceful shutdown in foreground workflows).

### What we changed:
- Signals handed back to plugins: 
- DefaultCommand resets SIGINT/SIGTERM to defaults immediately before
exec’ing the plugin.
- Rationale: since exec replaces the process image, signals should be
delivered to (and handled by) the plugin without parent interference.
  - Non‑plugin commands remain unaffected by this change.
  - Compatibility: No change to plugin ABI or exec flow.

### Alternatives considered:
- Supervising child instead of exec: central forwarding of signals from
parent to plugin. Rejected for now to avoid changing process tree/stdio
semantics; resetting to defaults before exec preserves current model
while fixing signal interference.

## Testing
- [X] Tested locally
- [ ] Added/updated tests
- [ ] Added/updated docs
2025-09-05 20:49:54 -07:00
Kathryn Baldauf 17a1a3e2c7 Allow kernel set with tar to use relative paths to tar file (#582)
## Type of Change
- [x] Bug fix

## Description
Allow kernel set with tar to use relative paths to tar file. Fixes
https://github.com/apple/container/issues/573.

## Motivation and Context
`absoluteString` will prefix a scheme to the file path that looks like
"file://". This will cause file manager to fail to find the file at the
file path even if it exists. Change to instead just get the `path` of
the file, which does not add a scheme prefix.

## Testing
- [x] Tested locally

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-09-05 11:55:36 -07:00
Kathryn Baldauf d6b2243c75 Add force option to kernel set and add tests for kernel setting (#579)
## Type of Change
- [x] New feature  

## Description
Add option to force kernel setting and tests for CLI `kernel set`.
Related to https://github.com/apple/container/pull/575.

## Motivation and Context
This PR adds additional tests to ensure that we can set kernels from
local files, remote tar files, and local tar files. A new option `force`
is added to the `kernel set` subcommand which will overwrite an existing
kernel with the same name if one exists to make testing easier. The
tests ensure that a container can be started with the newly set kernel
and resets to the default recommended kernel when complete.

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

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-09-05 11:51:07 -07:00
Kathryn Baldauf cb2f424420 Support following symlinks in tar when setting default kernel (#575)
## Type of Change
- [x] Bug fix

## Description
This PR checks if the found entry in the archive for the requested
kernel path is a symlink, and if so, follows the symlink. I've opened a
separate issue to track creating tests for kernel downloading here
https://github.com/apple/container/issues/574 and will create a
follow-up PR for those.

## Motivation and Context
This PR fixes an issue reported in
https://github.com/apple/container/issues/475 where installing a kernel
from a tar archive does not follow symlinks in the archive.

## Testing
- [x] Tested locally

Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
2025-09-04 14:10:37 -07:00