Starting, stopping and sizes
When a host runs, what it keeps while stopped, and what it costs.
A Docker host runs only while someone uses it, so you never have to remember to turn it off.
When it runs
| Event | What happens |
|---|---|
| You run a command, or open a port forward | A stopped host starts and reloads its images, in about 15 to 30 seconds. A running one answers at once. |
| 10 minutes with no connection | It stops. |
| It has run for its run time | It stops: 8 hours by default, set by your admin between 10 minutes and 7 days. If data is still moving through it, from commands, builds, pulls or forwarded ports, it keeps running an hour at a time, up to 12 hours from its start. A connection left open with nothing moving doesn't count. Connect again to start a new stretch. |
| 15 minutes before it stops for good | The Docker hosts page warns you, with a Keep running 1 h button that gives it another hour, past 12 hours too. |
| You press Stop now | It stops at once. |
| 11 days stopped | The Docker hosts page and the Activity page warn you. Start it once to keep its images and volumes for another 14 days. |
| 14 days stopped | Its images and volumes are deleted. The host itself stays: its next start puts it on a new, empty machine with the same name, keys and address, so your docker context keeps working. |
What a stop keeps
- Kept: images and volumes, including database data in named volumes.
- Stopped: running containers. Start them again, or give them
restart: unless-stopped. - Kept, through the host's cache: build cache from
docker compose buildin a folder set up with Use in a folder, and from builds that ask for it. See Keep the build cache.
Keep the build cache
Docker's own build cache doesn't survive a stop, so each host runs a small cache registry, raftrun-cache, whose data is a volume, and volumes are kept. A build that writes its cache there and reads it back skips every step that hasn't changed, also on the first build after a stop. The cache never leaves the host: nothing extra goes over your connection.
Compose
Use in a folder sets this up for you. When the folder has a compose file, it writes compose.override.yaml with the cache for each service that builds, keeps it out of git, and Compose reads it by itself. Run the setup again after you add a service. If the project already has its own override file, setup leaves it alone; add this to each service that builds, with your project and service name:
services:
web:
build:
cache_from:
- type=registry,ref=localhost:15555/my-project/web:cache
cache_to:
- type=registry,ref=localhost:15555/my-project/web:cache,mode=max,ignore-error=truedocker build
Add the two cache flags, with a name of your own for the image:
docker build -t my-app \
--cache-from type=registry,ref=localhost:15555/my-app:cache \
--cache-to type=registry,ref=localhost:15555/my-app:cache,mode=max,ignore-error=true \
.Good to know
RUN --mount=type=cachefolders, such as npm's, pip's or cargo's download cache, are kept too, by the host itself and for every build: at a stop their contents are packed and saved, and at the next start they are put back. Not those that setuid,gidormode: they start empty after a stop. Together they may use a tenth of the disk.- When the host stops, old cache entries are cleared, and a cache larger than a quarter of the host's disk is dropped and starts again empty.
raftrun-cacheshows among your containers. If you remove it, it comes back the next time the host starts; builds meanwhile run without a cache rather than fail.
Sizes and cost
Hosts come in the same sizes as runners, at the same prices, billed by the second while running. A stopped host costs nothing.
| Size | vCPU | Memory | Disk | Per minute running | Per hour |
|---|---|---|---|---|---|
raft-ubuntu-24.04-xsmall | 0.5 | 1 GB | 20 GB | $0.000075 | $0.0045 |
raft-ubuntu-24.04-small | 1 | 2 GB | 20 GB | $0.00015 | $0.009 |
raft-ubuntu-24.04 | 2 | 4 GB | 20 GB | $0.0003 | $0.018 |
raft-ubuntu-24.04-4 | 4 | 8 GB | 40 GB | $0.0006 | $0.036 |
raft-ubuntu-24.04-8 | 8 | 16 GB | 100 GB | $0.0012 | $0.072 |
raft-ubuntu-24.04-16 | 16 | 32 GB | 200 GB | $0.003333 | $0.20 |
A 4 vCPU host used for 3 hours a day, 20 days a month, runs 3,600 minutes: $2.16.
Change a size from the size menu on the Docker hosts page. Images and volumes move with it. A running host stops to change size and starts at the new size on the next connection.
Rules
An admin decides, on the Team page:
- how many hosts each person may have: 1 by default, 0 to turn hosts off for someone;
- which sizes they may pick;
- the run time before a host stops.
The workspace's default rules apply to everyone; rules set for one person override them. Admins and members can have hosts; billers and viewers can't. Lowering a limit never removes hosts someone already has.
Delete a host
Deleting removes its machine, images and volumes for good. Copy out anything you need first, for example with docker cp or docker run --rm -v pgdata:/data alpine tar c /data > pgdata.tar.