Switch from Docker to Apple Container for macOS-native container isolation. Use when the user wants Apple Container instead of Docker, or is setting up on macOS and prefers the native runtime. Triggers on "apple container", "convert to apple container", "switch to apple container", or "use apple container".
70
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
This skill switches NanoClaw's container runtime from Docker to Apple Container (macOS-only). It uses the skills engine for deterministic code changes, then walks through verification.
What this changes:
docker → container-v path:path:ro → --mount type=bind,source=...,target=...,readonlydocker info → container system status (with auto-start)docker ps --filter → container ls --format jsondocker → container.env shadowing via mount --bind inside the container (Apple Container only supports directory mounts, not file mounts like Docker's /dev/null overlay)mount --bind, then drop privileges via setprivWhat stays the same:
--user flag)Verify Apple Container is installed:
container --version && echo "Apple Container ready" || echo "Install Apple Container first"If not installed:
.pkg filecontainer --versionApple Container requires macOS. It does not work on Linux.
grep "CONTAINER_RUNTIME_BIN" src/container-runtime.tsIf it already shows 'container', the runtime is already Apple Container. Skip to Phase 3.
git remote -vIf upstream is missing, add it:
git remote add upstream https://github.com/qwibitai/nanoclaw.gitgit fetch upstream skill/apple-container
git merge upstream/skill/apple-containerThis merges in:
src/container-runtime.ts — Apple Container implementation (replaces Docker)src/container-runtime.test.ts — Apple Container-specific testssrc/container-runner.ts — .env shadow mount fix and privilege droppingcontainer/Dockerfile — entrypoint that shadows .env via mount --bindcontainer/build.sh — default runtime set to containerIf the merge reports conflicts, resolve them by reading the conflicted files and understanding the intent of both sides.
npm test
npm run buildAll tests must pass and build must be clean before proceeding.
container system status || container system start./container/build.shecho '{}' | container run -i --entrypoint /bin/echo nanoclaw-agent:latest "Container OK"mkdir -p /tmp/test-ro && echo "test" > /tmp/test-ro/file.txt
container run --rm --entrypoint /bin/bash \
--mount type=bind,source=/tmp/test-ro,target=/test,readonly \
nanoclaw-agent:latest \
-c "cat /test/file.txt && touch /test/new.txt 2>&1 || echo 'Write blocked (expected)'"
rm -rf /tmp/test-roExpected: Read succeeds, write fails with "Read-only file system".
mkdir -p /tmp/test-rw
container run --rm --entrypoint /bin/bash \
-v /tmp/test-rw:/test \
nanoclaw-agent:latest \
-c "echo 'test write' > /test/new.txt && cat /test/new.txt"
cat /tmp/test-rw/new.txt && rm -rf /tmp/test-rwExpected: Both operations succeed.
npm run build
launchctl kickstart -k gui/$(id -u)/com.nanoclawSend a message via WhatsApp and verify the agent responds.
Apple Container not found:
.pkg filecontainer --versionRuntime won't start:
container system start
container system statusImage build fails:
# Clean rebuild — Apple Container caches aggressively
container builder stop && container builder rm && container builder start
./container/build.shContainer can't write to mounted directories: Check directory permissions on the host. The container runs as uid 1000.
| File | Type of Change |
|---|---|
src/container-runtime.ts | Full replacement — Docker → Apple Container API |
src/container-runtime.test.ts | Full replacement — tests for Apple Container behavior |
src/container-runner.ts | .env shadow mount removed, main containers start as root with privilege drop |
container/Dockerfile | Entrypoint: mount --bind for .env shadowing, setpriv privilege drop |
container/build.sh | Default runtime: docker → container |
7454673
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.