We raised $3M for agent-native runners

Stop downloading the test image on every build

Cache the container image the tests run in, so each build reuses the copy it already has.

How Ramp used this technique

Read what Ramp changed and follow the original sources.

Stop downloading the test image on every build

Each build pulled the last-built Docker image from the registry, which took 1 to 2 minutes. Ramp's new test runners were self-hosted, so the image stayed in the runner's local Docker cache between builds. On GitHub-hosted runners, which start empty, a job that builds the image may cut the same overhead with a persisted build cache (the OPT4 recipe), and a job that only pulls a prebuilt public image may cut it by saving and loading the image through the Actions cache; measure the restore time against the pull it replaces.

Local Docker caching shaved over a minute off a run that took about fifteen minutes by then. Source

Use it when
Jobs pull or rebuild the same container image on every run and spend a minute or more on it.
Before applying it
A cached image must still rebuild when its inputs change, so key the cache on the Dockerfile and the lockfiles it copies in.

Company Playbooks