> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Apple Container

> Connect either Mirage SDK to an existing container under Apple's container tool.

Start the container yourself. Apple's `container` needs Apple silicon and
macOS 26 or later; live FUSE mounts need `SYS_ADMIN`. Details:
[Python](/python/runtime/sandbox/apple_container) ·
[TypeScript](/typescript/runtime/sandbox/apple_container).

Run these commands from the Mirage repository root:

```bash theme={null}
brew install container
container system start
container build -f docker/sandbox/Dockerfile --target fuse \
  -t mirage-python-fuse .
container run -d --cap-add SYS_ADMIN \
  --name my-sandbox mirage-python-fuse sleep infinity
```

`mirage-python-fuse` is the local image name assigned by `-t` during the
build. The image contains Python, Mirage, and FUSE (Filesystem in Userspace),
which makes workspace backends accessible as ordinary files inside the
container.

<Note>
  The example reuses Mirage's shared Python image to serve workspace mounts
  inside the container. Your host application can use either SDK, including
  TypeScript; the two communicate through `container exec`.
</Note>

| Part of `container run` | Meaning                                                                          |
| ----------------------- | -------------------------------------------------------------------------------- |
| `-d`                    | Run the container in the background.                                             |
| `--cap-add SYS_ADMIN`   | Allow the FUSE mounts used to expose workspace files.                            |
| `--name my-sandbox`     | Give this container a name; use it in the runtime's `container` config.          |
| `mirage-python-fuse`    | Use the image built above.                                                       |
| `sleep infinity`        | Keep the container running while Mirage sends commands through `container exec`. |

This starts the container. Follow the Python or TypeScript guide above to
copy your workspace configuration into it and mount your backends before
running commands that use workspace files.

<Tabs>
  <Tab title="Python SDK" icon="https://mintcdn.com/struktoai/F9Lv_nTaj6By6crk/images/python-logo.svg?fit=max&auto=format&n=F9Lv_nTaj6By6crk&q=85&s=cf5b268d330f7db46ea5cf6083f309a1" width="110" height="110" data-path="images/python-logo.svg">
    ```python theme={null}
    from mirage.runtime.sandbox.apple_container import AppleContainerRuntime

    runtime = AppleContainerRuntime(captures=["python3"], config={"container": "my-sandbox"})
    ```
  </Tab>

  <Tab title="TypeScript SDK" icon="https://mintcdn.com/struktoai/F9Lv_nTaj6By6crk/images/typescript-logo.svg?fit=max&auto=format&n=F9Lv_nTaj6By6crk&q=85&s=63a620cb702b16103c53ea361a17504a" width="512" height="512" data-path="images/typescript-logo.svg">
    ```typescript theme={null}
    import { AppleContainerRuntime } from '@struktoai/mirage-node'

    const runtime = new AppleContainerRuntime({
      captures: ['python3'],
      config: { container: 'my-sandbox' },
    })
    ```
  </Tab>
</Tabs>
