# Local container runtime

> For the complete documentation index, see [llms.txt](https://docs.ringleader.dev/llms.txt).


> The local container runtime is the Linux virtual machine Ringleader runs on your computer for docker.


The local container runtime is the Linux virtual machine Ringleader runs on your computer for
`docker`. Creating it switches your `docker` command to it, so you can run containers without
Docker Desktop. To create, configure or delete it, follow
[Run containers with the local container runtime](https://docs.ringleader.dev/guides/run-local-container-runtime/).
If your computer shows the welcome flow's **Run containers on this computer**
screen, choosing **Use Ringleader's runtime** there creates it, as
[Complete Ringleader setup](https://docs.ringleader.dev/guides/complete-ringleader-setup/) describes.

## The runtime and the Ringleader daemon

The runtime runs only while the Ringleader daemon runs, so it starts when you open the
application or run `rl daemon start`. It runs on your computer's default local provider. On a
computer where no local provider can run a workstation, `rl local-runtime create` refuses, and
names `rl status`, which says why. [Create the local runtime](https://docs.ringleader.dev/guides/run-local-container-runtime/#create-the-local-runtime)
shows how to create it.

The runtime is a workstation named `local-runtime`, in the `local` namespace. The Ringleader
application shows it on the **Local runtime** tab of **Settings**, not on its **Workstations**
page. Configuration layers in `local` can reach it, as
[Layers and the local runtime](https://docs.ringleader.dev/workstations/configuration/configuration-layers/#layers-and-the-local-runtime)
describes. [Delete the local runtime](https://docs.ringleader.dev/guides/run-local-container-runtime/#delete-the-local-runtime)
removes it.

## Published container ports

Ringleader forwards each port a container publishes to your computer's `localhost`. So your own
browser and tools reach a container in the runtime with no extra step. Only ports a
container publishes reach your computer this way. The runtime's own system services aren't
exposed.

A container in a runtime on vz, the provider Ringleader picks on a Mac, can't reach services
running on your Mac, such as a database on its `localhost`. [Reach a service on your Mac](https://docs.ringleader.dev/workstations/providers/mac/#reach-a-service-on-your-mac)
says how to carry one in.

## Folders the runtime shares with your Mac

On a Mac, a runtime on vz, the provider Ringleader picks there, shares four standard volumes
with your containers, at the same paths as on your Mac:

| Standard volume | Folder |
|-----------------|--------|
| `users` | `/Users` |
| `volumes` | `/Volumes` |
| `private` | `/private` |
| `private-var-folders` | `/var/folders`, where your Mac keeps `$TMPDIR` |

A container can read and write them, so `docker run -v "$PWD":/app` and a compose file's
`./src:/app` work unchanged:

```bash
docker run --rm -v "$PWD":/app alpine ls /app    # lists your current folder
```

If `/app` is empty in a runtime you created earlier, run `rl local-runtime create` again. That
gives the runtime these folders, and restarts it once. To share fewer folders, follow
[Choose the folders the runtime shares](https://docs.ringleader.dev/guides/run-local-container-runtime/#choose-the-folders-the-runtime-shares).

`/tmp` isn't shared, so `-v /tmp/x:/x` reaches the runtime's own `/tmp`, not your Mac's. A
`docker run -v` source outside the shared folders shows up in the container as an empty
folder, without an error.

An edit you save on your Mac reaches a file watcher inside a container, as
[File changes in a shared folder](https://docs.ringleader.dev/workstations/providers/mac/#file-changes-in-a-shared-folder)
describes.

<div class="callout callout-warning">
  <p class="callout-title">Do not run an agent in the runtime</p>
  <div class="callout-body">
    Anything that runs as root in the runtime can read and change everything in the folders it
shares. With the standard volumes, that includes <code>~/.ssh</code> and <code>~/.ringleader</code>. <code>~/.ringleader</code>
holds the workstations on your Mac and the key that logs in to each of them. Ringleader shares these
folders with the local runtime only: a workstation you create shares none of them unless its
own spec lists them. Run an agent in a workstation of its own, not in the runtime.
  </div>
</div>


## Folder limits from your organization

Your organization can limit the folders a runtime shares, with the `mounts` setting of its
[host-access rules](https://docs.ringleader.dev/reference/resources/policy/#workstation-reach-on-the-computer).
Under `readOnly`, `rl local-runtime create` shares the standard volumes read-only. Under
`none`, it shares none of them. Either way, it prints a line saying what it changed.

When the limit doesn't allow a folder you name with `--volume` or `volume add`, Ringleader
refuses it. Under `readOnly`, it also refuses a folder you name writable, so add `:ro` to it.
The runtime still records the folders you chose, and the next `create` after your organization
lifts the limit shares them again. `rl local-runtime status` and `rl local-runtime volume list`
show the folders the runtime started with: read-only under `readOnly`, and none under `none`.
Ringleader never forwards changes from `/Volumes`, whatever the limit.

## Folders on Windows

On Windows, a container can't mount a folder by its Windows path. For example,
`docker run -v C:\\Users\\you\\project:/app` fails, because Docker reads `/app` as a mount mode.
You can still run `docker build` from a Windows folder. To get files into a container instead,
follow
[Get files into a container on Windows](https://docs.ringleader.dev/guides/run-local-container-runtime/#get-files-into-a-container-on-windows).

## Next steps

- [Run containers with the local container runtime](https://docs.ringleader.dev/guides/run-local-container-runtime/)
  creates the runtime, chooses its shared folders and deletes it.
- [`rl local-runtime`](https://docs.ringleader.dev/reference/cli/commands/local-runtime/) lists every form of the command
  and its flags.
- [Repair Docker after removing Docker Desktop](https://docs.ringleader.dev/guides/repair-docker-after-removing-docker-desktop/)
  fixes `docker` when Docker Desktop's removal left its settings behind.
- [Local runtime](https://docs.ringleader.dev/reference/desktop-application/#local-runtime) describes the
  **Local runtime** tab.

