Menu

Docker Build Cache on Ephemeral CI Runners: inline, registry and local, Measured
📰

Docker Build Cache on Ephemeral CI Runners: inline, registry and local, Measured

DEV Community: cicd·DevOps Daily·8 days ago
#r6zacwOz
#devtocicd#devto#dev#reg#cache
Reading 0:00
15s threshold

A CI runner that starts empty has no BuildKit cache, so every docker build is a cold build unless you export the cache somewhere and import it on the next run. We rebuilt a real multi-stage Node service, the payment service from Google's Online Boutique demo, on a brand-new BuildKit builder every time, with five setups: no cache, inline , registry with mode=min , registry with mode=max , and a local cache directory.

For a one-line source change, every cache worked. The rebuild went from 79.0 s with no cache to 19.2 to 26.3 s with any registry-backed cache, because BuildKit skipped the whole builder stage, npm install included. For this Dockerfile, the cheapest backends were the best ones. Inline and registry mode=min cost 0.0 and 1.2 s to export. Inline adds only metadata to the image, and mode=min stored a separate 47.7 MB cache with the same layers as the image.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.