Quickstart¶
Get a multi-container application running on Apple Container in 2 minutes.
Prerequisites¶
- Apple Silicon Mac: Required for the native container runtime.
- macOS 26 (Tahoe): Recommended for the best experience.
- Apple Container: Installed and running.
- Container-Compose: Installed via Homebrew.
Step 1: Create your project¶
Create a new directory and a minimal compose.yaml file.
Add the following content to compose.yaml:
Step 2: Start the application¶
Launch your services in detached mode.
Step 3: Verify status¶
Check that your container is running.
Step 4: Test the service¶
Verify the Nginx server is responding on the mapped port.
Step 5: Clean up¶
Stop and remove the containers when you are finished.
Using a .env file¶
Create a .env file in the same directory as your compose file:
Reference the variables in compose.yaml:
Container-Compose loads ./.env by default. Pass a different file with --env-file:
Verify substitution before starting:
Multi-service with depends_on¶
This example starts a web service only after Redis passes its healthcheck.
services:
web:
image: nginx:alpine
ports:
- "8080:80"
depends_on:
redis:
condition: service_healthy
redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
Container-Compose enforces the ordering: redis must reach a healthy state before web starts. If redis has no healthcheck block, the condition falls back to service_started (running state). See Troubleshooting — depends_on with service_healthy if the wait does not behave as expected.
What's Next¶
- Explore the CLI Reference for advanced flags.
- Check out Tutorials for complex architecture examples.
- Read Limitations and Gotchas before dropping in an existing stack.
- See Troubleshooting if something is not working.
Essential Commands¶
| Command | Description |
|---|---|
up |
Create and start containers. |
down |
Stop and remove containers, networks, and images. |
ps |
List containers. |
logs |
View output from containers. |
build |
Build or rebuild services. |
exec |
Execute a command in a running container. |
run |
Run a one-off command on a service. |
watch |
Watch for file changes and update containers. |