For the complete documentation index, see llms.txt. A markdown version of this page is at /guides/run-local-container-runtime/index.md.

Run containers with the local container runtime

Create the local container runtime, choose the folders it shares, and delete it, so you can run containers without Docker Desktop.

Create the local container runtime, choose the folders it shares, and delete it, so you can run containers without Docker Desktop. Creating the runtime switches your docker command to it. The runtime is a Linux virtual machine that Ringleader runs on your computer.

Prerequisites

  • Ringleader installed on a Mac or a Windows PC.
  • The examples use the runtime’s own name, local-runtime, and a project folder at ~/code/myproject. Replace the folder with yours.
  • Local container runtime explains the runtime and what it shares, if you want to read it first.

Create the local runtime

Use the application

  1. Open Settings, then the Local runtime tab.
  2. Click Create Local Container Workstation. Ringleader creates the runtime, switches docker to it, and waits until Docker in the runtime answers.

Use the command line

Run this command. Ringleader creates the runtime, switches docker to it, and waits until Docker in the runtime answers.

rl local-runtime create

rl local-runtime lists every form of the command and its flags. rl --help doesn’t list the command, because the application drives it.

Check that the runtime works

To check that it works, start a container that publishes a port, and reach it from your computer:

  1. Start the container:

    docker run -d -p 8888:80 nginx
  2. Reach the container from your computer:

    curl localhost:8888

Choose the folders the runtime shares

On a runtime on vz, you can share fewer folders than the four standard volumes. A share flag is refused on a runtime that doesn’t run on vz.

Changing the folders restarts the runtime, which stops its running containers. The runtime records your choice, so running rl local-runtime create again, or Re-apply Local Container Workstation in the application, keeps it. create refuses a folder that doesn’t exist on your Mac, and changes nothing.

Use the application

  1. In Settings, open the Local runtime tab and find its Shared folders section. It lists the folders on your Mac that docker run -v can give a container.
  2. Use the switch of each of the four standard volumes to turn it on or off. Click Add folder to pick another folder, or Remove next to one you added.
  3. Click Apply. It first says that the runtime restarts and its running containers stop, and then applies your changes. Before the runtime exists, the button at the top creates it with the folders you chose.

The section makes the same change as rl local-runtime create with its share flags, as Local runtime describes.

Use the command line

To share only $TMPDIR and one project folder, run:

rl local-runtime create --standard-volumes private-var-folders --volume ~/code/myproject

--volume, or -v, takes a folder in the shape docker run -v uses:

  • ~/code/app shares the folder at the same path in the runtime.
  • ~/code/app:/src shares it at /src in the runtime.
  • ~/code/app:ro or ~/code/app:/src:ro shares it read-only. A folder is writable unless its value ends in :ro.

To change one folder at a time, use rl local-runtime volume:

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

Get files into a container on Windows

On Windows, a container can’t mount a folder by its Windows path, so get files into a container in one of these ways instead:

  • Keep files the container owns in a named volume.
  • Copy files into or out of a container with docker cp.
  • Copy a folder into the runtime with rl file cp -r ./project local-runtime:/home/dev/workspace/project, then mount that runtime path in a container.

Delete the local runtime

Containers, images and volumes are deleted

Deleting the runtime removes the containers, images and volumes in it, and switches docker back to the Docker context you had before.

Use the application

Click Delete on the runtime’s card on the Local runtime tab.

Use the command line

Run:

rl local-runtime delete

Next steps