feat: add Apple container runtime support#211
Open
OVELYB wants to merge 4 commits into
Open
Conversation
feat: v0.3.3 Main PR
Add Apple container runtime detection on macOS, including runtime_container_apple.go implementation and corresponding tests in container_detect_test.go and runtime_container_test.go.
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.
Description
Add support for Apple's
containerCLI tool as a container runtime backend. Thecontainertool (github.com/apple/container) runs Linux containers as lightweight VMs on macOS using the Virtualization framework, and is becoming increasingly popular as a Docker Desktop alternative on Apple Silicon Macs.This PR:
runtime_container_apple.goimplementing theContainerRuntimeinterface for Apple containercontainer ls --format json --alloutput to list containers with full metadata (image, state, networks, mounts, ports, command)Enrich()viacontainer inspectto get accurate container start timescontainer_detect.gofor process-level container identificationHostPID()returns 0 since VM-based containers have no direct host PID mappingNote:
containeris macOS-only (uses the macOS Virtualization framework). The implementation is safe on Linux —Available()returnsfalsewhen the binary is absent.Type of change
Check all that apply:
Checklist
go fmt ./...stagingbranchTest Plan
Environment: macOS 26 (Apple Silicon) with
containerinstalled via Homebrew.Steps:
container system start— start the container daemoncontainer run -d --name test-nginx nginx:latest— start a test containergo run ./cmd/witr -i— launch witr TUIAdditional verification:
go build ./...— compiles without errors on macOSgo vet ./...— no warningsgo test ./...— all existing tests pass (no regressions)runtime_container_apple.gocompiles cleanly,Available()returnsfalsesincecontainerbinary doesn't exist on LinuxScreenshots