Skip to content

feat(mega-linter-runner): support Apple's native container engine on macOS - #8956

Merged
nvuillam merged 2 commits into
oxsecurity:mainfrom
snaquekiller:feature/apple-container-engine
Sep 16, 2026
Merged

nvuillam merged 2 commits into
oxsecurity:mainfrom
snaquekiller:feature/apple-container-engine

Conversation

@snaquekiller

Copy link
Copy Markdown
Contributor

Proposed Changes

  1. Add container to --container-engine (docker/podman/container) to run MegaLinter with Apple's native container CLI on Apple Silicon (macOS 15+), without Docker Desktop: https://github.com/apple/container
  2. Branch pull/inspect/logs per engine, since Apple's container CLI is not docker-CLI-compatible:
    • image pull / image inspect live under the image subcommand (there is no bare pull/inspect)
    • image inspect is JSON-only (no --format Go template) - parsed for a matching variants[].platform.{os,architecture} to keep the "skip pull for pinned versions already available locally" optimization
    • logs uses -n <n> instead of --tail <n>
  3. Update README and CHANGELOG, add unit tests for CLI parsing and for the --timeout cleanup path with --container-engine container

Related to #1160 (podman engine request) - this adds a third engine option for Apple Silicon users who don't want Docker Desktop.

Readiness Checklist

Author/Contributor

  • Add entry to the CHANGELOG listing the change
  • Documentation updated (README)

…macOS

Add "container" to --container-engine (alongside docker/podman) to run
MegaLinter with Apple's container CLI on Apple Silicon, without needing
Docker Desktop: https://github.com/apple/container

Apple's container has no `docker pull`/`docker inspect --format`
equivalents, so pull/inspect/logs are branched per engine:
- image pull/inspect live under the `image` subcommand
- `image inspect` is JSON-only (no --format), parsed for platform match
- `logs` uses `-n <n>` instead of `--tail <n>`

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Guitton Nicolas <nguitton@cegid.com>
@nvuillam

Copy link
Copy Markdown
Member

@snaquekiller looks good, thanks for the PR :)
Did you check locally with npm link from your local MegaLinter repo ?

@echoix echoix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally fine, I'm disappointed that Apple took such a generic name, but it's really the name used throughout the project's GitHub page.

Comment thread mega-linter-runner/README.md Outdated
…sibling rows

Per review from @echoix: the table row was the only one with an inline
explanation and URL for one of its allowed values. The detail (Apple
Silicon, apple/container link) is already in --help and the usage
example, so the table row now just lists the allowed values like the
other rows do.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Guitton Nicolas <nguitton@cegid.com>
@snaquekiller

Copy link
Copy Markdown
Contributor Author

Yes, just did — this Mac is Apple Silicon with container v1.4.1 already installed and running (container system status).

npm link from the branch, then:

mega-linter-runner --linter PYTHON_RUFF --container-engine container --platform linux/arm64 --path . sample.py

Real pull of ghcr.io/oxsecurity/megalinter-only-python_ruff:latest via container image pull (28 blobs, ~102MB, unpacked for linux/arm64), then container run started the container, MegaLinter ran, ruff correctly flagged the unused import os in my test file, SARIF report was written to megalinter-reports/python_ruff/. --rm cleaned it up — container list --all showed nothing left afterward.

So the full path (pull → run → cleanup) works end-to-end against the real container engine, not just the mocked unit tests.

@snaquekiller

Copy link
Copy Markdown
Contributor Author

Like you suppose i have done everything with AI. i try to do it as clean as possible . i check myself if it's seem ok. For me i didn't saw anything miss. Feel free if you saw anything wrong :) . Im more happy to help and do better.

@nvuillam
nvuillam merged commit baf2c7a into oxsecurity:main Sep 16, 2026
10 checks passed
@nvuillam

Copy link
Copy Markdown
Member

@snaquekiller that's ok to do everything in AI, there is kind of 1 year i've not written a single line of code :)

What makes the differences are the harness around (megalinter has one, starts with /analyze), and how to developer drives the AI and reviews what has been generated :)

@nvuillam

Copy link
Copy Markdown
Member

@snaquekiller now available with mega-linter-runner@beta :)

@snaquekiller
snaquekiller deleted the feature/apple-container-engine branch September 16, 2026 14:33
@snaquekiller

Copy link
Copy Markdown
Contributor Author

tested on my way this morning work well. thanks :) <3

@nvuillam

Copy link
Copy Markdown
Member

Great, thanks for the feedback 😊

@snaquekiller
snaquekiller restored the feature/apple-container-engine branch September 18, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants