Installation & Setup
Requirements
bash
1# Apple silicon is required2uname -m # arm643
4# Apple's project currently supports macOS 26+5sw_versInstall Apple Container
bash
1# Open the official releases page and download the signed .pkg installer2open https://github.com/apple/container/releases3
4# After installation, verify the CLI is available5container system versionStart the Service
bash
1container system start2container system status3container system versionUpgrade, Downgrade, Uninstall
bash
1# Stop services before changing versions2container system stop3
4# Upgrade to the latest release5/usr/local/bin/update-container.sh6
7# Install a specific release8/usr/local/bin/update-container.sh -v <version>9
10# Uninstall but keep user data11/usr/local/bin/uninstall-container.sh -k12
13# Uninstall and remove user data14/usr/local/bin/uninstall-container.sh -dUseful Aliases
bash
1alias ctr='container'2alias ctrls='container ls'3alias ctri='container image'4alias ctrsys='container system'System & Service Commands
Health, Version, Logs
bash
1container system start2container system stop3container system status4container system status --format json5container system version6container system logs7container system logs --last 1h8container system logs -f9container system df10container system property list11container system property list --format jsonDNS & Kernel Management
bash
1# Create a local DNS domain for containers2sudo container system dns create dev.local3container system dns list4sudo container system dns delete dev.local5
6# Install or refresh the recommended kernel7container system kernel set --recommendedContainer Lifecycle
Run Containers
bash
1container run -it ubuntu:latest /bin/bash2container run --rm alpine:latest echo "hello"3container run -d --name web -p 8080:80 nginx:latest4container run -e NODE_ENV=production --cpus 2 --memory 1G node:205container run -v "$PWD":/workspace -w /workspace ubuntu:latest bash6container run --ssh -it ubuntu:latest bash7container run --rosetta --platform linux/amd64 ubuntu:latest bashCreate, Start, Stop, Remove
bash
1container create --name job ubuntu:latest sleep 3002container start -a job3container stop job4container stop --all5container kill job6container rm job7container rm --all8container pruneList, Inspect, Logs, Exec
bash
1container ls2container ls -a3container ls --format json4container inspect web5container logs web6container logs -f -n 100 web7container exec -it web /bin/sh8container exec -e DEBUG=1 -w /app web ./bin/start9container stats10container stats --no-stream web11container stats --format json --no-stream webCopy Files & Export Filesystems
bash
1# Copy host -> container2container cp ./config.yaml web:/etc/app/3
4# Copy container -> host5container cp web:/var/log/nginx/access.log ./logs/6
7# Export a stopped container filesystem8container stop web9container export -o web.tar webImage Build & Management
Build Images
bash
1container build -t my-app:latest .2container build -f Dockerfile.prod -t my-app:prod .3container build --target production --no-cache -t my-app:prod .4container build --build-arg NODE_ENV=production -t my-app .Image Commands
bash
1container image ls2container image pull alpine:latest3container image inspect alpine:latest4container image tag my-app:latest registry.example.com/team/my-app:latest5container image push registry.example.com/team/my-app:latest6container image save -o my-app.tar my-app:latest7container image load -i my-app.tar8container image rm my-app:latest9container image pruneRegistry Authentication
bash
1container registry login registry.example.com2container registry list3container registry logout registry.example.comNetworks, Volumes & Builder
Networks
bash
1container network create app-net2container network create --subnet 192.168.100.0/24 app-net3container network ls4container network inspect app-net5container run -d --name api --network app-net nginx:latest6container network rm app-net7container network pruneVolumes
bash
1container volume create mydata2container volume create -s 10G build-cache3container volume ls4container volume inspect mydata5container run -v mydata:/data alpine:latest6container volume rm mydata7container volume pruneBuilder
bash
1container builder start2container builder status3container builder stop4container builder rmCommon Workflows
Quick Web Server
bash
1container run -d --name web -p 8080:80 nginx:latest2container logs -f web3container exec -it web /bin/sh4container stop web5container rm webLocal Development Mount
bash
1container run --rm -it \2 -v "$PWD":/workspace \3 -w /workspace \4 ubuntu:latest \5 bashBuild and Push
bash
1container build -t registry.example.com/team/my-app:latest .2container registry login registry.example.com3container image push registry.example.com/team/my-app:latest