Skip to content

Built a Docker-compatible CLI layer on top of container — sharing for feedback #574

@us

Description

@us

Hey folks,

I've been using Apple's container CLI since WWDC and love the VM-per-container security model. But coming from Docker, I kept hitting friction points in my daily workflow:

  • No docker-compose.yml support — I have multi-service projects I couldn't easily migrate
  • No docker ps-style table output with status, ports, names
  • No docker network/docker volume subcommands
  • No --name, --restart, --label flags on container run
  • Scripts that assumed docker just broke

So I built Mocker — a thin Docker-compatible CLI wrapper written in Swift that delegates to container under the hood.

What it does:

  • Same commands and flags as Docker (run, ps, stop, rm, exec, logs, build, inspect, stats, ...)
  • mocker compose up -d reads your existing docker-compose.yml with full dependency ordering, variable substitution, networks and volumes
  • Existing Docker scripts work without modification — just replace docker with mocker
  • Persists container/network/volume metadata as JSON in ~/.mocker/

What it doesn't do:

  • It's not reimplementing the runtime — it's just a compatibility and orchestration layer on top of what Apple already built

A few things I ran into building this that might be worth noting as missing features or docs gaps:

  1. No --rm equivalent in container run — had to implement stop+delete manually, and container stop on an already-exited container waits for the full graceful shutdown timeout (~10s). Would be great to have a --rm flag or a way to skip stop for already-exited containers.

  2. container compose — is this on the roadmap? Would make tools like mine unnecessary.

  3. virtiofs + chown — postgres and similar images that chown their data directory at init fail with "Operation not permitted". Known limitation, just flagging it for anyone who hits it.

Happy to hear if there's a better approach, or if any of this is already planned. The project is open source if anyone wants to poke at it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions