Docker Compose compatible CLI for Apple container.
dctl translates docker compose commands into Apple container CLI invocations, letting you use familiar Compose workflows with the container runtime.
- macOS 15+
- container CLI installed and running (
container system start) - Go 1.23+ (to build from source)
git clone https://github.com/sonnes/dctl.git
cd dctl
make build
# Binary is at bin/dctl
# Optionally install to PATH:
make installdctl works with standard compose.yaml / docker-compose.yml files.
# Start all services in detached mode
dctl compose up -d
# Start and build images first
dctl compose up -d --build
# View running services
dctl compose ps
# Follow logs
dctl compose logs -f
dctl compose logs -f web # specific service
# Execute a command in a running service
dctl compose exec web bash
# Run a one-off command
dctl compose run --rm web npm test
# Stop services
dctl compose stop
# Stop and remove containers, networks
dctl compose down
# Stop and remove everything including volumes
dctl compose down -v
# Restart services
dctl compose restart
# Build service images
dctl compose build
# Pull service images
dctl compose pull
# Validate compose file
dctl compose config
# Remove stopped containers
dctl compose rm
# Force stop services
dctl compose kill-f, --file Compose configuration file(s) (can be specified multiple times)
-p, --project-name Project name (defaults to directory name)
--project-directory Alternate working directory
--profile Activate a profile
--env-file Alternate environment file
--debug Enable debug output
| Variable | Description |
|---|---|
DCTL_CONTAINER_BIN |
Path to the container binary (auto-detected if not set) |
DCTL_DEBUG |
Enable debug output |
dctl parses standard Compose files (compose.yaml, compose.yml, docker-compose.yml, docker-compose.yaml) and supports:
image,build(context, dockerfile, args, target, labels)command,entrypointenvironment,env_fileports,volumes,tmpfsnetworks,dns,dns_searchdepends_on(withservice_started,service_healthy,service_completed_successfullyconditions)working_dir,user,hostnamelabels,platformtty,stdin_open,read_onlycpus,mem_limitrestart,stop_signal,stop_grace_periodcontainer_name,pull_policyhealthcheck
name(project name)services(required)networks(create/external)volumes(create/external)
- Environment variable interpolation:
${VAR},${VAR:-default},${VAR-default} - Multiple compose files via
-f(merged in order) - Dependency ordering via
depends_on(topological sort with cycle detection) - Rollback on failure during
up(stops already-started services) - Project state tracking in
~/.dctl/projects/
dctl is a translation layer, not a reimplementation. Each compose command orchestrates one or more container CLI calls:
| dctl compose | container CLI |
|---|---|
up |
network create + volume create + run --detach (per service, in dependency order) |
down |
stop + delete (per container) + network delete + volume delete |
ps |
list --format json (filtered by project) |
logs |
logs (per service) |
exec |
exec |
run |
run (with service config + overrides) |
build |
build (per service with build config) |
pull |
image pull (per service) |
stop |
stop (per service) |
restart |
stop + start (per service) |
rm |
delete (per service) |
kill |
kill (per service) |
config |
Parse and print resolved YAML |
These Docker Compose features are not supported by the container runtime:
privileged,cap_add,cap_drop(VM-based isolation, not namespace-based)network_mode: hostextra_hosts/add-hostdevices,gpusloggingdriversdeploy(replicas, resources, placement)healthcheck(parsed but not actively polled duringup)profiles(parsed but not filtered)secrets,configswatchmode
dctl/
├── main.go # Entry point
├── cmd/
│ ├── app.go # Root CLI command
│ └── compose.go # All compose commands and flag translation
├── pkg/
│ ├── runner/
│ │ └── runner.go # Executes container CLI commands
│ └── compose/
│ ├── types.go # Compose file structs
│ ├── parser.go # YAML parsing with env interpolation
│ ├── graph.go # Dependency graph (topological sort)
│ └── project.go # Project state management
├── go.mod
├── go.sum
└── Makefile
Built by Ravi Atluri and Claude Code (Anthropic's AI coding agent).
Apache License 2.0