# Local runtime

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


> Create, check and delete the local container runtime that your docker command talks to.


`rl local-runtime` creates, checks and deletes the local container runtime that your `docker`
command talks to. The application's create and delete buttons run this command, so a terminal
gives you the same runtime. `rl --help` doesn't list the command.
[Local container runtime](https://docs.ringleader.dev/reference/local-container-runtime/)
explains the runtime and the folders it shares.

```bash
rl local-runtime create        # create the runtime and switch docker to it
rl local-runtime status        # print the runtime's status
rl local-runtime delete        # delete it and switch docker back
```

## `rl local-runtime create`

Apply the runtime, create the `ringleader` Docker context pointing at the runtime's Docker
socket, record the context you had before, and switch `docker` to `ringleader`. The command then
waits for Docker in the runtime to answer, for up to ten minutes. `rl local-runtime up` is the
same command.

Running `create` again on a runtime that exists applies the runtime again, and keeps the
provider it runs on and the folders it shares. On a Mac or a Windows PC, `create` also repairs
Docker settings that removing Docker Desktop broke, as
[Repair Docker after removing Docker Desktop](https://docs.ringleader.dev/guides/repair-docker-after-removing-docker-desktop/)
describes. If the repair fails, `create` says so and still creates the runtime.

| Flag | Description |
|------|-------------|
| `--provider <name>` | Run the runtime on this local provider instead of the one your computer picks. A runtime that exists keeps its provider, so to move it, delete it first. |
| `--no-wait` | Return once the runtime is applied instead of waiting for Docker. |
| `--timeout <duration>` | How long to wait for Docker (default `10m`). `0` waits without a limit. |
| `--standard-volumes <list>` | On a Mac, for a runtime on vz, the standard volumes the runtime shares: `all`, `none`, or a comma-separated list of names. |
| `-v, --volume <folder>` | On a Mac, for a runtime on vz, share one more folder, as `HOST[:GUEST][:ro\|rw]`. Repeat it for more folders. The folders you name replace the ones the runtime recorded. |
| `--no-volumes` | On a Mac, for a runtime on vz, share no folders beyond the standard volumes. |
| `--dry-run`, `-o yaml` or `-o json` | Print what `create` would apply and change nothing: no runtime and no Docker context. |
| `--as <subject>` | Impersonate a subject. `status` and `delete` take it too. |
| `--home <dir>` | Data directory. `status` and `delete` take it too. |

A share flag you leave out keeps what the runtime recorded. A share flag is refused on a runtime
that doesn't run on vz.

## `rl local-runtime status`

Print the runtime's status, phase and provider. With no runtime, it prints these lines:

- `Runtime: not created. Run \`rl local-runtime create\``.
- `Existing:` names any other Docker runtime this computer is set up for.
- `Default socket:`, on a Mac, gives the setting
  [Let tools find Docker at the default socket](https://docs.ringleader.dev/reference/desktop-application/#let-tools-find-docker-at-the-default-socket)
  describes.

With a runtime, it prints the `Runtime:` and `Existing:` lines, then these:

- `Repair:` names each Docker setting that a removed Docker Desktop left broken, ending in
  `(fix: rl local-runtime repair-docker)`.
- `Docker:` gives the socket's path and whether Docker answers through it.
- `Shared folders:`, on a runtime on vz, lists the folders the runtime shares.
- `Default socket:`, on a Mac, as above.

## `rl local-runtime delete`

Delete the runtime, switch `docker` back to the context you had before, and remove the
`ringleader` context. `rl local-runtime down` is the same command.

While `docker` is still on the `ringleader` context, `delete` switches it to the context that
was current when you ran `create`. If that context is gone, it switches to `desktop-linux` when
Docker Desktop's context exists, and otherwise to `default`. If you had already switched to
another context yourself, `delete` leaves your choice alone and only removes the `ringleader`
context. The same restore runs when you delete the runtime with
`rl workstation delete local-runtime`, from the application, or from the terminal UI.

If the switch fails, `delete` leaves the `ringleader` context in place and says so. Fix the
cause, then run `rl local-runtime delete` again. It reports the runtime as already gone and
finishes the restore. `rl workstation delete local-runtime` does the same when it finds the
runtime already gone.

Neither `create` nor `delete` needs Docker to be installed. When no `docker` command is found,
`create` says it skipped the Docker context. `delete` prints a notice to run
`docker context use default` after installing Docker.

## `rl local-runtime volume`

Add, remove or list the folders a runtime on vz shares from a Mac, one at a time. `add` takes a folder
in the same shape as `--volume`.

```bash
rl local-runtime volume add ~/code/other:ro
rl local-runtime volume remove /Volumes     # turns the volumes standard volume off
rl local-runtime volume list
```

## `rl local-runtime repair-docker`

Repair the Docker settings a removed Docker Desktop left broken, and do nothing else. It prints
`Nothing to repair.` when nothing is broken.
[Repair Docker after removing Docker Desktop](https://docs.ringleader.dev/guides/repair-docker-after-removing-docker-desktop/)
shows when to run it.

The repair changes a setting only when it is clearly broken, and leaves a setup that works
alone. It edits `config.json` in your Docker configuration folder: `~/.docker` on a Mac and
`%USERPROFILE%\.docker` on Windows, unless `DOCKER_CONFIG` names another. It needs no
administrator rights and writes nowhere else. It doesn't change your current Docker context.

The repair makes two changes:

- It sets `credsStore` to `ringleader`, the name of a sign-in helper that Ringleader installs:
  Docker's own `osxkeychain` helper on a Mac, and its `wincred` helper on Windows. If that helper
  isn't installed, the repair leaves `credsStore` alone and says so. It never removes
  `credsStore`, because Docker would then store your sign-ins in `config.json` as plain text.
- It adds the folder where Ringleader keeps `docker compose` and `docker buildx` to
  `cliPluginsExtraDirs`.

Before the repair rewrites `config.json`, it saves the old file beside it as
`config.json.pre-ringleader`. It never overwrites a backup that exists.

## `rl local-runtime default-socket`

Turn on or off the macOS link from `/var/run/docker.sock` to the runtime, as
[Let tools find Docker at the default socket](https://docs.ringleader.dev/reference/desktop-application/#let-tools-find-docker-at-the-default-socket)
describes.

