Repository navigation
Add container clean (reclaim disk space) for container 1.4.1 - #15
Merged
Merged
Conversation
`container clean` (new in 1.4.1) trims freed blocks on a running container's root filesystem and named volume mounts so the host can reclaim the space from the sparse rootfs.ext4 / volume.img files. Nothing is deleted; the CLI skips read-only roots and `ro` mounts. - ContainerService.clean(ids:) + cleanArguments(ids:) wrap the command. - Clean is offered wherever a running container has actions: the row's context/ellipsis menu, the inspector header, the ⌘K palette (routed through the Containers screen so the busy marker and error banner give feedback), and a "Clean running containers" button with confirmation in the System screen's Reclaim space row. - CLIs older than 1.4.1 reject the unknown subcommand with a usage error; that is surfaced as "requires Apple container 1.4.1 or later" instead of the raw parser text. - Tests cover argv, output parsing, and the version-requirement mapping. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TLMTFj27fkhmYuisPRZaVr
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apple container 1.4.1 added
container clean, a one-shot trim of freed blocks on a running container's root filesystem and named volume mounts so the host reclaims space from the sparserootfs.ext4/volume.imgfiles (apple/container#1949, #2228). Nothing is deleted, and the CLI skips read-only roots andromounts.This wires it into the app:
ContainerService.clean(ids:)/cleanArguments(ids:).containerrejects the unknown subcommand with a usage error; the UI shows "Cleaning containers requires Apple container 1.4.1 or later" instead of the parser text.Test plan
xcodebuild build(app target) succeedsxcodebuild test: 144 tests in 19 suites pass, including newcontainerClean,cleanSendsIDsAndReturnsCleanedList, andcleanOnOlderCLIExplainsVersionRequirementalpine:3.21container:notFounderror line, exit 1 (so the bulk System-screen action reports partial failures as an error, with the failing id named)internalError: "failed to clean container" (cause: "notFound: …"), which the existing classifier maps to.notFound