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
- Open Settings, then the Local runtime tab.
- Click Create Local Container Workstation. Ringleader creates the runtime, switches
dockerto 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 createrl 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:
Start the container:
docker run -d -p 8888:80 nginxReach 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
- In Settings, open the Local runtime tab and find its Shared folders section. It lists the folders on your Mac that
docker run -vcan give a container. - 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.
- 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/appshares the folder at the same path in the runtime.~/code/app:/srcshares it at/srcin the runtime.~/code/app:roor~/code/app:/src:roshares 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 listGet 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
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 deleteNext steps
- Local container runtime explains the runtime, the folders it shares and the limits your organization can set on them.
- Repair Docker after removing Docker Desktop
fixes
dockerwhen Docker Desktop’s removal left its settings behind. rl local-runtimelists every form of the command and its flags.